### 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 (filter->get_selected() == filter->get_item_count() - 1) {
		
	} else if (filters.size() > 1 && filter->get_selected() == 0) {
		
		for (int i = 0; i < filters.size(); i++) {
			String f = filters[i].get_slice(";", 0);
			for (int j = 0; j < f.get_slice_count(","); j++) {
				patterns.push_back(f.get_slice(",", j).strip_edges());
			}
		}
	} else {
		int idx = filter->get_selected();
		if (filters.size() > 1) {
			idx--;
		}
		if (idx >= 0 && idx < filters.size()) {
			String f = filters[idx].get_slice(";", 0);
			for (int j = 0; j < f.get_slice_count(","); j++) {
				patterns.push_back(f.get_slice(",", j).strip_edges());
			}
		}
	}
	while (!files.is_empty()) {
		bool match = patterns.is_empty();
		for (const String &E : patterns) {
			if (files.front()->get().matchn(E)) {
				match = true;
				break;
			}