Repository navigation
Conversation
|
@tokainz is attempting to deploy a commit to the njevric's projects Team on Vercel. A member of the Team first needs to authorize it. |
tokainz
force-pushed
the
fix/529-inputotp-delete-key
branch
from
November 16, 2026 21:59
d6e058b to
6648804
Compare
tokainz
force-pushed
the
fix/529-inputotp-delete-key
branch
from
November 16, 2026 22:02
6648804 to
74afae9
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Pressing
Deletein the middle of anInputOtpfield removed the character, but then moved the focus to the next field with the caret at the end, so further presses ofDeletedid nothing.The
inputevent withinputType: 'deleteContentForward'was handled like typing and calledmoveToNext(). Because the model is joined without gaps, the following values shift one field to the left on re-render, which also cleared the selection in the newly focused field.deleteContentForwardnow keeps the focus on the current field and selects its new value after the re-render. PressingDeleterepeatedly removes the following characters one by one, like in a regular text field.Example old:
Fill InputOtp with the values 1, 2, 3, 4 and focus the field with value
1. PressDeleteand the value1will be deleted but the focus will jump to the second field and the caret is placed at the end of the input so pressingDeleteagain does nothing.Example new:
Fill InputOtp same as above. Focus Value
1. PressDeleteand value1will be deleted and value2will be in its place. The focus should stay on the first Input. PressDeleteagain and value2will also be deleted, and so on.Also:
deleteentry to the accessibility doc of InputOtp.InputOtp.spec.jsbecause there were no tests for the InputOtp yet. Besides the Delete key, it covers props, typing, max length, arrow keys, Backspace and paste.Related issue
Closes #529
Checklist
pnpm run lintandpnpm run formatpass## [Unreleased]inCHANGELOG.md