Pin input field not working with iOS SMS autocomplete
See original GitHub issue🐛 Bug report
The PinInput
s nested within a PinInputField
are not correctly set when using the iPhone’s autofill functionality.
This is only happening in Safari. I’ve tested with Edge, Chrome, Opera, Brave, Firefox and Firefox Focus and these all work as expected.
💥 Steps to reproduce
- Receive an SMS message with an OTP
- Navigate to https://chakra-ui.com/docs/form/pin-input#using-fields-as-a-one-time-password-otp
- Select the first pin input
- Click on the available OTP from the keyboard
- Only some inputs will be set
🌍 System information
Chakra UI: Latest 1.6.2 Browser: Mobile Safari iOS (tested in iPhone 8 and iPhone 12) Operating system: Latest 14.2.1
📝 Additional information
https://user-images.githubusercontent.com/3072458/119651245-175d7400-be25-11eb-997b-1ec3ed51aa80.MP4
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:15 (4 by maintainers)
Top Results From Across the Web
Pin input field not working with iOS SMS autocomplete -
The PinInput s nested within a PinInputField are not correctly set when using the iPhone's autofill functionality.
Read more >Enabling Password AutoFill on an HTML input element
To ensure your HTML input element displays the right AutoFill suggestion, set the autocomplete attribute for an input element. Use the following autocomplete ......
Read more >How to enable/disable OneTimeCode feature for specific text ...
Make sure that message that is coming in SMS contains either "code" either "passcode" and message can be copied. available from iOS 12....
Read more >Learn How to Autofill SMS Login Codes in iOS 12 and Mojave
The most common is via an SMS text message to your iPhone, ... When you're prompted for your code, tap in the Enter...
Read more >ion-input: Custom Input Value Type Styling and CSS Properties
The default type is "text" . Angular JavaScript. React Vue. iOS. MD ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had the same scene and already did some tests. I think the reason is that iOS Safari fill in the captcha manner is different with Chrome. The Chrome triggers just once “onchange”, but the iOS Safari will quickly (maybe 10ms) trigger multiple times and enter one at a time. The render view about 16ms, so set some value will be not enough fast.
I’m trying to make it right. It’s a live demo. https://codesandbox.io/s/naughty-danny-zp31zr?file=/src/index.tsx
@with-heart I will investigate.