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

/
if (d["dir"]) {
					path = path.path_join(d["name"]);
					break;
				}
			}
		}
		_save_to_recent();
		hide();
		emit_signal(SNAME("dir_selected"), path);
	}
	if (mode == FILE_MODE_SAVE_FILE) {
		bool valid = false;
		if (filter->get_selected() == filter->get_item_count() - 1) {
			valid = true; 
		} else if (filters.size() > 1 && filter->get_selected() == 0) {
			
			for (int i = 0; i < filters.size(); i++) {
				String flt = filters[i].get_slice(";", 0);
				for (int j = 0; j < flt.get_slice_count(","); j++) {
					String str = flt.get_slice(",", j).strip_edges();
					if (f.match(str)) {
						valid = true;
						break;
					}
				}
				if (valid) {
					break;
				}
			}
		} else {