Closed es1831 closed 9 months ago
Hello!
Any updates on this? Cause same problems for iOS / Android auto-paste from SMS - code is not being parsed correctly and only first number is pasted.
Also running into this issue on Android, pasting from clipboard works but pasting from sms messages doesn't.
I am facing same issue which was posted by @AzurDrive, Please give a solution as soon as possible @ajayns, @apollonian
@DeadEnglish @Janviba911 yo guys, i can share my "hack" and overall thoughts on this library. So, you see, ths component renders 4 separate inputs, 1st input is auto-focused (default), and when you try to paste code from sms, it is pasted in this 1st input, but only 1st digit, cause maxLength is 1. Then all the rest logic - proceed inputing to other 3 inputs - doesnt work here like with pasting from clipboard. Because code got pasted directly to rendered input, not to React OTP component (somehow).
So my solution. Make on top of react-otp (place them in one container). Input should be numeric-based, maxLength 4, autofocused, controllable. color and background are transparent. also set react-otp to pointerEvents: none. Share the contolled input to react.state and pass that value to react-otp component too. all the rest styles are on yours.
@AzurDrive can you share the code?
The feature is available in: https://www.npmjs.com/package/react18-input-otp
Hi! any update on this issue? Im facing the same problem. Thanks!!
@es1831 Can you check if this issue still exists with v3.
It works for ios safari but such a screen appears. When I hit close it copies all the code. Could the console be forgotten somewhere?
I believe I have a fix for this in this PR here: https://github.com/devfolioco/react-otp-input/pull/428
This was fixed with #428
https://user-images.githubusercontent.com/8410389/114436022-de2db500-9b92-11eb-9b6a-45bf0624ebcd.mp4