Merge pull request #101842 from havi05/tree-fix-ui_select

Tree - fix `ui_select`
This commit is contained in:
Thaddeus Crews 2025-01-21 11:55:28 -06:00
commit 672fd7b0bb
No known key found for this signature in database
GPG key ID: 62181B86FE9E5D84

View file

@ -3682,15 +3682,6 @@ void Tree::gui_input(const Ref<InputEvent> &p_event) {
prev->select(selected_col);
}
ensure_cursor_is_visible();
} else if (p_event->is_action("ui_accept") && p_event->is_pressed()) {
if (selected_item) {
//bring up editor if possible
if (!edit_selected()) {
emit_signal(SNAME("item_activated"));
incr_search.clear();
}
}
accept_event();
} else if (p_event->is_action("ui_select") && p_event->is_pressed()) {
if (select_mode == SELECT_MULTI) {
if (!selected_item) {
@ -3705,6 +3696,15 @@ void Tree::gui_input(const Ref<InputEvent> &p_event) {
}
}
accept_event();
} else if (p_event->is_action("ui_accept") && p_event->is_pressed()) {
if (selected_item) {
//bring up editor if possible
if (!edit_selected()) {
emit_signal(SNAME("item_activated"));
incr_search.clear();
}
}
accept_event();
}
if (allow_search && k.is_valid()) { // Incremental search