diff options
author | Felix Yuan <jihadfeeves@gmail.com> | 2024-10-31 00:59:44 -0700 |
---|---|---|
committer | Felix Yuan <jihadfeeves@gmail.com> | 2024-11-09 01:29:44 -0800 |
commit | f491d2fe2475bfd696a2094b60f5ae55efb3d2ad (patch) | |
tree | 86b9135c2dab76c25402f477ce36e0a33db098f7 /editor/gui | |
parent | e65a23762b36b564eb94672031f37fdadba72333 (diff) | |
download | redot-engine-f491d2fe2475bfd696a2094b60f5ae55efb3d2ad.tar.gz |
Don't try to move selection if there are no visible elements
Diffstat (limited to 'editor/gui')
-rw-r--r-- | editor/gui/editor_quick_open_dialog.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/editor/gui/editor_quick_open_dialog.cpp b/editor/gui/editor_quick_open_dialog.cpp index b8f3b259ca..0128f1f54c 100644 --- a/editor/gui/editor_quick_open_dialog.cpp +++ b/editor/gui/editor_quick_open_dialog.cpp @@ -489,6 +489,10 @@ void QuickOpenResultContainer::handle_search_box_input(const Ref<InputEvent> &p_ } void QuickOpenResultContainer::_move_selection_index(Key p_key) { + // Don't move selection if there are no results. + if (num_visible_results <= 0) { + return; + } const int max_index = num_visible_results - 1; int idx = selection_index; |