-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
AutoFill doesn't work correctly on Safari #80
Comments
In Safari (both mobile and desktop) autoFill works incorrect - it
inserts code from sms in first input ignoring others
Also, same issue when you get one-time-code from email (new feature
from MacOS Sonoma, Safari 17)
It may be related to
<#63>. Did you use the
latest version v3.1.4?
I've tried to debug a little and it seems onChange event doesn't fire
for autofill.
The issue was similar on Firefox mobile, onChange was not triggered
because the event.key was not standard. I needed to add this line to
make it work:
<https://github.com/soywod/react-pin-field/blob/61abac38660192f402ef9572bc9e2baea9614d4d/lib/src/pin-field/pin-field.tsx#L109>
Maybe you could try to log here and see what is the event.key when the
autocomplete is triggered?
|
Yes, its 3.1.4. I'll try to debug more. Hope to get some free time this week. I'll let you know if will figure out something. |
@soywod I've been playing around with this issue locally and figured out that using pin-field.tsx
|
Are there any reasons why you didn't use `onChange` for tracking input
value changes?
onChange is not triggered for non-visible characters like backspace or
arrows, and some old browsers do not support it properly (hence the
KeyboardEvent.key polyfill). I found it simpler to track changes using
onKeyDown and onKeyUp, but somehow it does not work as expected on
Safari. I have no macOS nor iOS so it is hard for me to test :/
|
That seems reasonable as to why you're using the other listeners, but @hraboviyvadim was not suggesting replacing the existing listeners, but rather including an additional Are there issues with adding the |
Are there issues with adding the `onChange` handler as well?
I could add the listener, I'm just afraid it may become
overcomplicated. onChange would be used only for a subpart (not
compatible browsers for visible characters only). I will give a try and
see how it behaves!
|
I have finally time to take care of this issue. I let you know whenever I have sth to show. |
I was able to try on a recent iOS (on Safari) and it worked as expected 🎉 |
Hi! Thanks for this lib, its awesome! But there is an issue which seems to be critical.
In Safari (both mobile and desktop) autoFill works incorrect - it inserts code from sms in first input ignoring others:
Also, same issue when you get one-time-code from email (new feature from MacOS Sonoma, Safari 17):

I've tried to debug a little and it seems onChange event doesn't fire for autofill.
The text was updated successfully, but these errors were encountered: