fix: keep Android keyboard sessions open

This commit is contained in:
Alexander Sellite 2026-08-16 23:04:07 -04:00
parent 80c570657b
commit d8c8886216
2 changed files with 8 additions and 19 deletions

View file

@ -306,9 +306,6 @@ func _handle_native_keyboard_input(event: InputEvent) -> void:
return
if key_event.keycode in [KEY_ENTER, KEY_KP_ENTER]:
return
# Android delivers IME edits after this input phase. Reassert the same field
# afterward in case a page refresh tried to move focus while its text changed.
_preserve_native_text_focus.call_deferred(focused)
func _open_native_keyboard_for(control: Control) -> void:
@ -326,20 +323,6 @@ func _close_native_keyboard(control: Control) -> void:
DisplayServer.virtual_keyboard_hide()
func _preserve_native_text_focus(control: Control) -> void:
if (
not _uses_native_virtual_keyboard()
or not is_instance_valid(control)
or not _can_edit(control)
or not control.is_inside_tree()
or not control.is_visible_in_tree()
or not bool(control.get("virtual_keyboard_enabled"))
):
return
if not control.has_focus():
control.grab_focus()
func _can_edit(control: Control) -> bool:
if (
control == null