You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3d58a47
Browse filesBrowse the repository at this point in the historyBrowse files
[iOS] Take the text input connection back when the platform reopens it
iOS takes first responder away from the FlutterTextInputView while system
UI that handles text itself is up -- most notably the AutoFill sheets such
as "Hide My Email" -- and gives it back once that UI is dismissed, at which
point it inserts the text the user picked.
That resignation is reported to the framework as
TextInputClient.onConnectionClosed, which is unrecoverable: EditableText
unfocuses the field and TextInput drops _currentConnection, so the text
arriving afterwards is discarded by the early return in
TextInput._handleTextInputInvocation. The keyboard stays up and the engine
keeps the same client id the whole time, but the field stays empty.
Traced on a physical device, the resignation and the text insertion are
seconds apart and the application is still active when the resignation is
reported, so the report cannot be suppressed or deferred on a timer. Make
it recoverable instead: when the view regains first responder for the same
client it reported closed, it tells the framework, which takes that same
connection back and refocuses the field through the existing
TextInputClient.onFocusReceived. Reusing the connection keeps the client id
the platform is holding valid, and the message travels on the channel that
carries the editing state updates, so the connection is restored before the
inserted text arrives.
Fixesflutter#157495
Co-Authored-By: Claude Opus 5 <[email protected]>
0 commit comments