Browse Source

[EditorFileDialog] Do not update file selection on filter change if nothing was previously selected.

bruvzg 8 months ago
parent
commit
348ee200f8
1 changed files with 5 additions and 3 deletions
  1. 5 3
      editor/gui/editor_file_dialog.cpp

+ 5 - 3
editor/gui/editor_file_dialog.cpp

@@ -1504,9 +1504,11 @@ void EditorFileDialog::_filter_changed(const String &p_text) {
 	search_string = p_text;
 	search_string = p_text;
 	invalidate();
 	invalidate();
 
 
-	item_list->deselect_all();
-	if (item_list->get_item_count() > 0) {
-		item_list->call_deferred("select", 0);
+	if (item_list->get_selected_items().size() > 0) {
+		item_list->deselect_all();
+		if (item_list->get_item_count() > 0) {
+			item_list->call_deferred("select", 0);
+		}
 	}
 	}
 }
 }