-
Notifications
You must be signed in to change notification settings - Fork 13.5k
feat(input-otp): add new input-otp component #30386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature-8.6
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thank you, @brandyscarney, for your work on this component. One feature suggestion: pressing CTRL+A (or CMD+A on macOS) inside the component could select and clear all input fields at once. This would align with common input behavior and improve UX for users needing to re-enter their code quickly. Example: https://input-otp.rodz.dev/ |
Screenshot.2025-05-13.at.13.18.12.mp4I was surprised by how well VoiceOver works on this since you said you didn't try it at all. There is some funkiness around highlighting from VoiceOver that we saw with some other components. I'm not sure how to address it here or if you even want to try now, but I thought I'd point it out. |
Co-authored-by: Shane <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good so far! I requested some changes and I think Voice Over has some issues. I didn't test with any other a11y systems though since I don't really have an easy way to do that, but I imagine they'll act pretty similarly to how I showed Voice Over acting. From previous experience, other screen readers handle this sort of focus issue better than Voice Over does, so they may even be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very close! Just missed one thing
Issue number: internal
What is the current behavior?
In order to re-create an OTP Input component users have to custom style an
<ion-input>
, possibly multiple, to get the design and functionality they want.What is the new behavior?
ion-input-otp
which provides the OTP input functionalitytype
which determines whether the boxes accept numbers or text/numbers and determines the keyboard to displayinputmode
propertylength
property to control the number of input boxesfill
,shape
,size
,color
separators
property to show a separator between 1 or more input boxesdisabled
,readonly
and invalid statespattern
propertyionInput
,ionChange
,ionComplete
,ionBlur
,ionFocus
reset
,setFocus
Does this introduce a breaking change?
Other information
Dev build:
8.5.7-dev.11747772857.11c9c939
Previews
Documentation