don't move the cursor with up/down arrow keys in search bar

This commit is contained in:
Lera Elvoé 2023-12-13 14:32:22 +03:00
parent 68d9af52c6
commit 0d7567e636
No known key found for this signature in database

View file

@ -83,6 +83,7 @@ func search(text: String) -> void:
## Callback for [member search_line_edit]'s input events. Handles highlighting items when navigating with up/down arrow keys. ## Callback for [member search_line_edit]'s input events. Handles highlighting items when navigating with up/down arrow keys.
func _on_search_line_edit_gui_input(event: InputEvent) -> void: func _on_search_line_edit_gui_input(event: InputEvent) -> void:
if event.is_action_pressed("ui_down"): if event.is_action_pressed("ui_down"):
search_line_edit.accept_event()
var category: Category var category: Category
for i: String in categories: for i: String in categories:
var c: Category = categories[i] var c: Category = categories[i]
@ -103,6 +104,7 @@ func _on_search_line_edit_gui_input(event: InputEvent) -> void:
scroll_container.ensure_control_visible(category.get_child(item + 1)) scroll_container.ensure_control_visible(category.get_child(item + 1))
if event.is_action_pressed("ui_up"): if event.is_action_pressed("ui_up"):
search_line_edit.accept_event()
var category: Category var category: Category
for i: String in categories: for i: String in categories:
var c: Category = categories[i] var c: Category = categories[i]