### Godot version

v4.2.dev4.mono.official [549fcce5f]

### System information

window10 64bit

### Issue description

![GIF 2023-9-1 22-39-07](https://github.com/godotengine/godot/assets/35988767/d7be4a45-f5f0-4408-8758-f4bf9f3c9c5d)


### Steps to reproduce

/

### Minimal reproduction project

/
mode_thumbnails->connect("pressed", callable_mp(this, &EditorFileDialog::set_display_mode).bind(DISPLAY_THUMBNAILS));
	mode_thumbnails->set_toggle_mode(true);
	mode_thumbnails->set_pressed(display_mode == DISPLAY_THUMBNAILS);
	mode_thumbnails->set_button_group(view_mode_group);
	mode_thumbnails->set_tooltip_text(TTR("View items as a grid of thumbnails."));
	pathhb->add_child(mode_thumbnails);
	mode_list = memnew(Button);
	mode_list->set_flat(true);
	mode_list->connect("pressed", callable_mp(this, &EditorFileDialog::set_display_mode).bind(DISPLAY_LIST));
	mode_list->set_toggle_mode(true);
	mode_list->set_pressed(display_mode == DISPLAY_LIST);
	mode_list->set_button_group(view_mode_group);
	mode_list->set_tooltip_text(TTR("View items as a list."));
	pathhb->add_child(mode_list);
	shortcuts_container = memnew(HBoxContainer);
	pathhb->add_child(shortcuts_container);
	drives = memnew(OptionButton);
	drives->connect("item_selected", callable_mp(this, &EditorFileDialog::_select_drive));
	pathhb->add_child(drives);
	makedir = memnew(Button);
	makedir->set_text(TTR("Create Folder"));
	makedir->connect("pressed", callable_mp(this, &EditorFileDialog::_make_dir));
	pathhb->add_child(makedir);
	list_hb = memnew(HSplitContainer);
	vbc->add_child(pathhb);
	vbc->add_child(list_hb);
	list_hb->set_v_size_flags(Control::SIZE_EXPAND_FILL);
	VSplitContainer *vsc = memnew(VSplitContainer);
	list_hb->add_child(vsc);
	VBoxContainer *fav_vb = memnew(VBoxContainer);