Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[ios] Fix keyboard flicker when switching text fieldsq#182661

Draft
koji-1009 wants to merge 1 commit intoflutter:masterfrom
koji-1009:fix/ios_keyboard_flicker
Draft

[ios] Fix keyboard flicker when switching text fieldsq#182661
koji-1009 wants to merge 1 commit intoflutter:masterfrom
koji-1009:fix/ios_keyboard_flicker

Conversation

@koji-1009
Copy link
Contributor

fix#180842

The issue was caused by#173598.

When there is a single TextField, the MethodChannel calls are as follows:

handleMethodCall: TextInput.setClienthandleMethodCall: TextInput.setEditableSizeAndTransformhandleMethodCall: TextInput.setMarkedTextRecthandleMethodCall: TextInput.setCaretRecthandleMethodCall: TextInput.setStylehandleMethodCall: TextInput.setEditingStatehandleMethodCall: TextInput.showhandleMethodCall: TextInput.requestAutofillhandleMethodCall: TextInput.clearClienthandleMethodCall: TextInput.hide

However, when there are two TextFields, the calls become:

handleMethodCall: TextInput.setClienthandleMethodCall: TextInput.setEditableSizeAndTransformhandleMethodCall: TextInput.setMarkedTextRecthandleMethodCall: TextInput.setCaretRecthandleMethodCall: TextInput.setStylehandleMethodCall: TextInput.setEditingStatehandleMethodCall: TextInput.showhandleMethodCall: TextInput.requestAutofillhandleMethodCall: TextInput.clearClienthandleMethodCall: TextInput.setClienthandleMethodCall: TextInput.setEditableSizeAndTransformhandleMethodCall: TextInput.setMarkedTextRecthandleMethodCall: TextInput.setCaretRecthandleMethodCall: TextInput.setStylehandleMethodCall: TextInput.setEditingStatehandleMethodCall: TextInput.showhandleMethodCall: TextInput.requestAutofillhandleMethodCall: TextInput.clearClienthandleMethodCall: TextInput.hide

In the multi-field case,clearTextInputClient is called beforesetTextInputClient for the next field. CallingremoveFromSuperview duringclearTextInputClient causes the keyboard to briefly dismiss and reappear (flicker).

This PR defers theremoveFromSuperview call fromclearTextInputClient tohideTextInput, using a pending flag (_pendingInputViewRemoval). The input view is removed only afterresignFirstResponder dismisses the keyboard.showTextInput resets the flag to prevent stale flags from causing unintended removal when switching fields.

For autofill contexts, a separate flag (_pendingAutofillRemoval) defers removal totriggerAutofillSave, preserving the existing autofill save behavior.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel onDiscord.

Note: The Flutter team is currently trialing the use ofGemini Code Assist for GitHub. Comments from thegemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

MaherSafadii and slightfoot reacted with hooray emoji
@github-actionsgithub-actionsbot added platform-iosiOS applications specifically engineflutter/engine related. See also e: labels. team-iosOwned by iOS platform team labelsFeb 20, 2026
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

engineflutter/engine related. See also e: labels.platform-iosiOS applications specificallyteam-iosOwned by iOS platform team

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

iOS 18.x ,TextField next focus keyboard disappears and appears again

1 participant

@koji-1009

Comments


[8]ページ先頭

©2009-2026 Movatter.jp