Replies: 1 comment
-
Thank you for the detailed feedback.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone,
I've been working with the VOTPInput component lately and have a couple of improvements that I think could be beneficial. I'd like to get some feedback before submitting a pull request and also open a discussion on a specific behavior.
Here's a summary of the changes:
1. Improved Paste Handling:
Currently, the component pastes clipboard data directly into the OTP input fields and slice it to
length.value
characters.I've modified the onPaste function to:
replace(/[\s\uFEFF\xA0]/g, '')
to trim and remove any whitespace (the removal of each whitespace is maybe a little bit too aggressive).These changes address the following test cases my team had:
2. Enhanced autofill focus event:
focusIndex.value = length.value - 1;
to focus on the last index when autofilling, otherwise the focus would just go to the second element and it seemed weird.3. Discussion Point: Partial Paste Behavior
I believe the changes in sections 1 and 2 enhance the usability and robustness of the VOTPInput component. I'm open to any feedback or suggestions you may have on these changes, as well as thoughts on the partial paste behavior.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions