### Godot version

v4.2.beta2.official [f8818f85e]

### System information

Windows 10, 64bit

### Issue description

Some times can't add node in visualshader editor

### Steps to reproduce

1. Open a VisualShader file for edit.
2. Click the `Add Node...` button, it will popup menu, it is OK.
3. Direct close the menu.
4. Clikd the `Add Node...` again, the menu can't popup.
![GIF](https://github.com/godotengine/godot/assets/35988767/1326c63e-3e05-4423-9ec7-7ce305b3f4f5)

### Minimal reproduction project

/
if (!preview_showed) {
		pending_update_preview = true;
		return;
	}
	String code = visual_shader->get_code();
	preview_text->set_text(code);
	ShaderLanguage::ShaderCompileInfo info;
	info.functions = ShaderTypes::get_singleton()->get_functions(RenderingServer::ShaderMode(visual_shader->get_mode()));
	info.render_modes = ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(visual_shader->get_mode()));
	info.shader_types = ShaderTypes::get_singleton()->get_types();
	info.global_shader_uniform_type_func = _visual_shader_editor_get_global_shader_uniform_type;
	for (int i = 0; i < preview_text->get_line_count(); i++) {
		preview_text->set_line_background_color(i, Color(0, 0, 0, 0));
	}
	String preprocessed_code;
	{
		String path = visual_shader->get_path();
		String error_pp;
		List<ShaderPreprocessor::FilePosition> err_positions;
		ShaderPreprocessor preprocessor;
		Error err = preprocessor.preprocess(code, path, preprocessed_code, &error_pp, &err_positions);
		if (err != OK) {
			ERR_FAIL_COND(err_positions.is_empty());
			String file = err_positions.front()->get().file;
			int err_line = err_positions.front()->get().line;
			Color error_line_color = EDITOR_GET("text_editor/theme/highlighting/mark_color");
			preview_text->set_line_background_color(err_line - 1, error_line_color);
			error_panel->show();