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
This commit is contained in:
parent
85c75da4ad
commit
0e90c6d6d1
1 changed files with 6 additions and 0 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue