soywod / react-pin-field

📟 React component for entering PIN codes.
https://soywod.github.io/react-pin-field/
MIT License
413 stars 24 forks source link

iOS "From Messages" Auto Paste #28

Closed vrockcm closed 3 years ago

vrockcm commented 3 years ago

Hello soywood,

I think I might have found problem with the onPaste handler.

When you receive a text message with the pin on iOS, the device usually gives you an option to auto enter it for you. Whenever I choose that option it only enters the first value into the input fields leaving other fields empty.

It works if you manually copy and paste the code in.

Thanks for making this awesome component

soywod commented 3 years ago

I don't think it comes from the onPaste event. It would either paste nothing or everything, but not just one character. Which version do you use? If you have version ^1.2 then you can try to inspect debug logs and see which event is triggered. It will be hard for me to debug since I don't own an iPhone, help is welcomed!

soywod commented 3 years ago

In fact I was able to reproduce with autoComplete="on" and selecting a completion (here I selected the left completion c'est and I got only the C):

It could be better if the selection acted like a paste. I will see how to deal with it. Thank you for the reporting!

vrockcm commented 3 years ago

Thank you for looking into this issue. I wish I could help but I am not that familiar with typescript.

soywod commented 3 years ago

It has been fixed in the v2.0.0-beta.0. The API slightly changed, I would advise to read the README and the CHANGELOG.

mattiLeBlanc commented 2 years ago

This issue is still current in version 3.0.15 on IOS Chrome:

https://user-images.githubusercontent.com/5285035/177256804-2570d7f3-04df-4cbe-8777-ec96e4c20bc1.mp4