Ralfarios / antd-input-otp

An OTP Input Component based on Ant Design Component Library for React.
https://www.npmjs.com/package/antd-input-otp
19 stars 4 forks source link

[BUG] - Pasting on Safari doesn't work #38

Closed duynlq closed 6 months ago

duynlq commented 8 months ago

Hi @Ralfarios,

Thank you very much for this custom component, which I am using for an authenticator for email OTP. While testing it on browsers, I am seeing the clipboard numerics does not paste to the input on the Safari browser, but it does paste on the Safari address bar. Let me know if I need to produce a test environment, but I think your CodeSandbox is enough.

Thank you again!

Are you using a TypeScript?

Yes

Ant Design Version

2.0.5

React Version

18.2.0

Ralfarios commented 8 months ago

Hello @duynlq !

Thanks for the report! I will check this and back to you ASAP!

Cheers, R.

RoudyTarabay commented 7 months ago

It's failing for me too with Next.js 14.02 on chrome.

I'll provide a reproduction when I can

diregraph commented 7 months ago

Having the same problem on the following specs:

"antd": "^5.6.0",
"antd-input-otp": "^2.0.4",
"react": "^18.2.0",
"typescript": "^4.9.3",
"vite": "^4.0.0"

on Chrome 121.0.6167.139 (Official Build) (arm64)

Ralfarios commented 6 months ago

Hello, @duynlq @RoudyTarabay @diregraph

Thanks for waiting, I've fixed the bug on the latest release v2.0.6, let me know if this still happens. https://github.com/Ralfarios/antd-input-otp/releases/tag/v2.0.6

Checkout the codesandbox here https://codesandbox.io/p/sandbox/clever-cache-1jmypp?file=%2Fpackage.json

Cheers, R.

duynlq commented 6 months ago

Issue still persists on Safari @Ralfarios.

Ralfarios commented 6 months ago

Issue still persists on Safari @Ralfarios.

@duynlq Could you reproduce this on codesandbox or something else for me?

Cheers, R.

duynlq commented 6 months ago

@Ralfarios I apologize, the fix indeed works when copying a code and pasting via right click, but not via command+V.

Ralfarios commented 6 months ago

Hello, @duynlq ..

My apologize and I'm truly thank you for reporting this bug. I think I know the culprit for this bug.

I will post the patch and let you know ASAP.

Again, sorry for the inconvenience. 🙏

Cheers. R.

Ralfarios commented 6 months ago

Hi, @duynlq

Thanks for waiting, I updated to the newest patch and made sure this issue has been fixed on the latest version (v2.1.0). Please give it a try. 🙏 https://codesandbox.io/s/antd-input-otp-demo-1jmypp

If the issue persists in this latest build, let me know.

Cheers, R.

duynlq commented 6 months ago

@Ralfarios Just wanted to let you know that this is my first issue on GitHub and it has been handled smoothly and successfully. Thank you for your hard work!

Is there any way that I can buy you a coffee?