Repository navigation
fix(ios): stop the AutoFill Passwords bar blinking while typing - #84
Open
shivapoudel wants to merge 1 commit into
Open
shivapoudel wants to merge 1 commit into
shivapoudel wants to merge 1 commit into
Conversation
In a WKWebView, typing in a username or password field makes UIKit set an empty suggestion list on every keystroke and put the AutoFill "Passwords" key back about 5-10 ms later. A frame drawn in between shows the QuickType bar empty, so the bar blinks as the user types. Native text fields and Safari do not set the empty list. While the bar shows an AutoFill key, hold an empty list for 100 ms: the next list replaces it, or it is applied late. A nil list (keyboard going away) is never held. If the private class or selector is missing, nothing is swizzled. The example app gets a username and a password field to reproduce it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shivapoudel
force-pushed
the
fix/ios-autofill-bar-blink
branch
from
October 9, 2026 06:13
664e5d0 to
207c474
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
On iOS 27, typing in a username or password field inside the Capacitor WebView makes the QuickType bar's AutoFill Passwords key blink on every keystroke. This PR keeps the bar steady without changing the page or turning AutoFill off.
Keyboard.mgets asteadyAutofillBarhook, installed once fromload, on-[UIKeyboardAutocorrectionController setAutocorrectionList:]:nillist (keyboard going away) and every other list pass straight through.WKContentViewswizzles are.The example app gets a username and a password field (
autocomplete="username"/"current-password") to reproduce it.Context
The system log shows the cause. On each keystroke in an AutoFill field, UIKit calls
setAutocorrectionList:twice:TIAutocorrectionList._UIKeyboardStateManager pushAutocorrections, with the AutoFill list again (oneTIKeyboardCandidateSinglewithisAutofillCandidate == YES).A frame drawn between the two shows an empty bar. That is the blink.
A native
UITextFieldwithtextContentType = .usernamenever gets the empty list, and neither does Safari. The difference seems to be the WKWebView path:WKContentViewis atextSuggestionDelegate. It looks like a UIKit/WebKit bug; I'm also filing it with Apple. Until that is fixed, apps can only avoid it withautocomplete="off", which removes the Passwords key.How the empty list looks varies:
predictionsisnil.@[].So "empty" here means nil or zero predictions, with no corrections.
Calling the
autocorrectionListgetter from inside the setter deadlocks (it waits on the keyboard task queue). So the hook tracks what is on screen only from the lists passed to the setter.This is new in iOS 27. iOS 26 sets no list per keystroke; see Tests. Reproduced on:
Type of changes
Platforms affected
Tests
iOS 27.0. Tested with the example app in this repo, on an iPhone 18 Pro Max simulator (Xcode 27.0):
Open the app, scroll down and tap Username (AutoFill). The keyboard shows the Passwords key.
Type
test@exaone character at a time.Watch the bar, and stream the log:
xcrun simctl spawn booted log stream --level debug --predicate 'process == "App"'Grep it for
setAutocorrectionListandKeyboard inserts text.In the sequences below,
|is a key insert,Eis an empty list applied, andPis the AutoFill list applied.main(f28aef4)EEP|EP|EP|EP|EP|EP|EP|EP|EPEEP|P|P|P|P|P|P|P|PThe
EEbefore the firstPis the keyboard's initial state and is unchanged. With the fix, no empty list reaches the bar between keystrokes. A 30 fps recording catches only some of the 5–10 ms gaps, which is whymainshows 2 blink frames for 8 keys, not 8. On a device it is visible on most keys.Also checked:
npm run lintandnpm run verify:iospass.iOS 26.0 (iPhone 17 Pro simulator, same example app): the bug does not happen there, and this change does nothing there.
nil, empty, AutoFill), never per keystroke. With temporary logging the sequence wasN E P | | | |.mainand of this PR both show 0 blink frames.So this is a regression in iOS 27. On older iOS, or wherever the private names are missing, the change is a no-op.
Screenshots (if appropriate)
Three consecutive frames from the
mainrecording while typing. The middle one is the blink:🤖 Generated with Claude Code