### 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

/
int current = p_item;
	if (current < 0 || current >= item_list->get_item_count()) {
		return;
	}
	Dictionary d = item_list->get_item_metadata(current);
	if (d["dir"]) {
		dir_access->change_dir(d["name"]);
		callable_mp(this, &EditorFileDialog::update_file_list).call_deferred();
		callable_mp(this, &EditorFileDialog::update_dir).call_deferred();
		_push_history();
	} else {
		_action_pressed();
	}
}
void EditorFileDialog::_item_list_item_rmb_clicked(int p_item, const Vector2 &p_pos, MouseButton p_mouse_button_index) {
	if (p_mouse_button_index != MouseButton::RIGHT) {
		return;
	}
	
	item_menu->clear();
	item_menu->reset_size();
	
	bool single_item_selected = item_list->get_selected_items().size() == 1;
	
	bool allow_delete = true;
	for (int i = 0; i < item_list->get_item_count(); i++) {
		if (!item_list->is_selected(i)) {