devfolioco / react-otp-input

:heavy_check_mark: OTP Input Component for React

Home Page:http://devfolioco.github.io/react-otp-input

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to eliminate blank spaces when pasting

VishnuPrasadhSR opened this issue · 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:

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?