question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pin input field not working with iOS SMS autocomplete

See original GitHub issue

🐛 Bug report

The PinInputs 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

  1. Receive an SMS message with an OTP
  2. Navigate to https://chakra-ui.com/docs/form/pin-input#using-fields-as-a-one-time-password-otp
  3. Select the first pin input
  4. Click on the available OTP from the keyboard
  5. 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:closed
  • Created 2 years ago
  • Reactions:7
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
lisonyangcommented, Mar 3, 2022

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

4reactions
cesarzagonelcommented, Jun 8, 2021

@with-heart I will investigate.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found