react-pin-field icon indicating copy to clipboard operation
react-pin-field copied to clipboard

Issue with last input field

Open salmabader opened this issue 1 year ago • 3 comments

Hi 👋🏻,

Firstly, thanks for your efforts in this library, it is really useful

I faced an issue with the last input field, when I try to clear it, the last two fields are cleared and this causes calling the onComplete twice. I tried to figure out the issue, but I didn't reach any solution :(

  • I'm using React with Next.js and Tailwind and I'm calling a custom function onComplete: onComplete={handleVerify} <PinField autoFocus ref={codeRef} onComplete={handleVerify} className='w-full rounded-md text-center placeholder:text-xs placeholder:text-gray-300 bg-my-gray border-gray-300 transition-all ease-soft-spring focus:shadow-md focus:ring-1 focus:shadow-sky-200 focus:outline-none hover:bg-my-200' id="code" placeholder='○' validate={/^[0-9]$/} />

ezgif-8-560513cd79

salmabader avatar Feb 12 '24 20:02 salmabader

I faced an issue with the last input field, when I try to clear it, the last two fields are cleared and this causes calling the onComplete twice.

I cannot reproduce this behaviour using the demo page. Could you provide a full working example so I can debug it?

soywod avatar Feb 13 '24 09:02 soywod

I just try it on production and it is working properly I'm facing this issue on my local only

salmabader avatar Feb 13 '24 10:02 salmabader

I'm facing this issue on my local only

I think it is a duplicate of https://github.com/soywod/react-pin-field/issues/92.

soywod avatar Feb 23 '24 05:02 soywod