react-otp-input icon indicating copy to clipboard operation
react-otp-input copied to clipboard

how to eliminate blank spaces when pasting

Open VishnuPrasadhSR opened this issue 1 year ago • 1 comments

*The issue is that when I paste a value with whitespace, it also counts the whitespace as value. *For instance, if I enter numInputs=6 and my value is space12space34space56, when I copy and paste it, it displaysspace12space34. *I tried using trim, but it didn't work. I also tried replace(/\s/g, "") , but it replaced the input value with an empty string.

  • Steps to reproduce the issue:

  • Relevant error messages and/or screenshots:

VishnuPrasadhSR avatar Mar 03 '23 10:03 VishnuPrasadhSR

We can probably add another prop for this that let's you customize how the component would parse the pasted value. Would you like to work on it?

prateek3255 avatar Mar 25 '23 14:03 prateek3255