1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-06 17:25:19 +00:00

Fix UI focus being shown when it shouldn't

This commit is contained in:
Michael Alexsander
2025-10-07 12:05:34 -03:00
parent 06faefc9f4
commit e32b9274a3
7 changed files with 39 additions and 16 deletions

View File

@@ -277,6 +277,7 @@ void EditorSpinSlider::_value_input_gui_input(const Ref<InputEvent> &p_event) {
case Key::ESCAPE: {
value_input_closed_frame = Engine::get_singleton()->get_frames_drawn();
if (value_input_popup) {
value_input_focus_visible = value_input->has_focus(true);
value_input_popup->hide();
}
} break;
@@ -612,6 +613,7 @@ void EditorSpinSlider::_evaluate_input_text() {
void EditorSpinSlider::_value_input_submitted(const String &p_text) {
value_input_closed_frame = Engine::get_singleton()->get_frames_drawn();
if (value_input_popup) {
value_input_focus_visible = value_input->has_focus(true);
value_input_popup->hide();
}
}
@@ -646,9 +648,10 @@ void EditorSpinSlider::_value_focus_exited() {
value_input_popup->hide();
}
} else {
// Enter or Esc was pressed.
grab_focus();
// Enter or Esc was pressed. Keep showing the focus if already present.
grab_focus(!value_input_focus_visible);
}
value_input_focus_visible = false;
emit_signal("value_focus_exited");
}