Skip to content
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

Pasting from clipboard on Android #280

Closed
es1831 opened this issue Apr 12, 2021 · 11 comments
Closed

Pasting from clipboard on Android #280

es1831 opened this issue Apr 12, 2021 · 11 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@es1831
Copy link

es1831 commented Apr 12, 2021

  • Describe the Feature Request
    Having an issue pasting a code from clipboard on android
screen-20210412-132430.mp4
  • Describe Preferred Solution
    should behave the same as pasting, where the numbers are auto-filled once you click on the number
@AzurDrive
Copy link

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.

@DeadEnglish
Copy link

Also running into this issue on Android, pasting from clipboard works but pasting from sms messages doesn't.

@Janviba911
Copy link

I am facing same issue which was posted by @AzurDrive, Please give a solution as soon as possible @ajayns, @apollonian

@AzurDrive
Copy link

@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.

@LuisValgoi
Copy link

@AzurDrive can you share the code?

@ritikbanger

This comment was marked as spam.

@dariohirsch
Copy link

Hi! any update on this issue? Im facing the same problem. Thanks!!

@prateek3255 prateek3255 added bug Something isn't working help wanted Extra attention is needed labels Mar 25, 2023
@prateek3255
Copy link
Collaborator

prateek3255 commented Mar 25, 2023

@es1831 Can you check if this issue still exists with v3.

@chocodate
Copy link

chocodate commented Mar 31, 2023

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?

IMG_0993

@hogiyogi597
Copy link
Contributor

I believe I have a fix for this in this PR here: #428

@prateek3255
Copy link
Collaborator

This was fixed with #428

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

10 participants