From 0e90c6d6d1f7b5d3eebb53536544a47bb26f0235 Mon Sep 17 00:00:00 2001 From: SuperTemich2005 Date: Sun, 11 Jan 2026 00:43:32 -0400 Subject: [PATCH] Fix LineEdit to reacquire Text Focus when enabled A fix for LineEdit to reacquire Text Focus when enabled while UI-focused. When the player has a UI-focus on a disabled LineEdit node and that node gets enabled, caret won't appear and arrow keys will shift UI focus to other Control nodes. By adding an if-check to call `edit()` in `set_enabled()` function, LineEdit will capture Text Input Focus when it gets enabled if the player has set UI focus on it. Fixes #114846 --- scene/gui/line_edit.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 8df276e3af..ec2e2ff0d7 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -2573,6 +2573,12 @@ void LineEdit::set_editable(bool p_editable) { unedit(); emit_signal(SNAME("editing_toggled"), false); } + + if (editable && has_focus() && !editing) { + edit(); + emit_signal(SNAME("editing_toggled"), true); + } + _validate_caret_can_draw(); update_minimum_size();