-
Notifications
You must be signed in to change notification settings - Fork 1k
[OneTimePasswordField] Fix iOS Chrome autocomplete #3654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
iOS chrome autocomplete only fires an `input` event up to the `maxLength`, so we need the input that “supports autocomplete” to accept the full OTP length. Later, in the `input` handler, the PASTE action will be dispatched.
🦋 Changeset detectedLatest commit: f7ad0d0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
- iOS Chrome fires onChange for the first input after firing `onInput` with the full code - If unchecked, the onChange handler will result in the _second_ input being pressed, after the PASTE action handler already focused the _final_ input
Compared to #3643, this PR:
|
@controversial Had an accidental lint error slip through on main. Mind updating your branch so tests can re-run in CI? |
@chaance I just rebased off the latest main; lints and tests are now passing, at least on my local |
@chaance It looks like this was released under |
Autocomplete in
OneTimePasswordField
s is broken on iOS Chrome, see #3641.This is because:
OneTimePasswordFieldInput
expects a password manager / autocomplete provider to enter the full code in the first input. When it encounters this case in theinput
event handler, it dispatches thePASTE
action.input
event’s value for themaxLength
property set on the target inputThe solution is to increase the
maxLength
on the input that expects to receive autocomplete input (the input that hassupportsAutoComplete
) so that it can receive up tocollection.size
characters of input, rather than just one.Closes #3641.
Adds additional handling for a bug caused by iOS Chrome firing
onChange
on the first input after it fires theinput
event—this had caused OneTimePasswordField to focus the second input where it should be focusing the final input (of the “pasted” value).(I’m not sure how to add tests for this PR as it’s specific to the iOS chrome environment, but I can try)