guilhermerodz / input-otp

One time passcode Input. Accessible & unstyled.
https://input-otp.rodz.dev
MIT License
2.35k stars 47 forks source link

Component Does Not Support Pasting Codes on Mobile #6

Closed severinlandolt closed 5 months ago

severinlandolt commented 6 months ago

Description

The OTP (One-Time Password) input component currently does not allow users to paste codes into the input fields. This limitation can affect the user experience, especially for those who rely on password managers or receive their OTP codes through messaging apps, requiring them to manually type the code each time.

Reprodution

  1. Copy an OTP code from your password manager or messaging app.
  2. Try pasting the OTP code into the OTP input field.
  3. Code does not get pasted as expected.

Expected behavior

Users should be able to paste the OTP code into the input field.

OS

OS: iOS 17.1 Browser: Safari

guilhermerodz commented 6 months ago

That's top 1 feature request. We need to find a way to let the user "longpress" the native input. The hold+paste action should be available on iOS and Android.

guilhermerodz commented 5 months ago

Commit 298fe7e works on mobile Chrome & Safari

https://github.com/guilhermerodz/input-otp/assets/10366880/958f6346-f5f6-4a1c-8b60-2468f034a810