-
Notifications
You must be signed in to change notification settings - Fork 8
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
Difficulty editing masked input text fields before final hyphen #265
Comments
@luigi how urgent is this? Was it reported by clients? |
Notes from today's investigation: in autoformatEventHandler, on every keystroke a new array is created and pushed into. It has something to do adding the special character when deleting a value before a special character and the total length has already been filled out. |
@coltborg Yes, clients have reported it. |
Summary@bengolder and I looked into fixing this masking issue and found some research on gov.uk that advised not to use masking at all.
We're inclined to deprecate input masking because we trust gov.uk's research, but we want to confirm with design and research before we do it. Short term recommendationWe advise to not use input masking by removing the How we tried to fix itWhen trying to fix the JavaScript, we found that inserting special characters as a client types has negative effects when using screen reader, it would read out odd wordings of what was typed as the characters are inserted or when caret position changes. We also attempted to fix this bug by correcting the cursor position in JavaScript, but this further exacerbated the odd way that VoiceOver would read back the input value to the user. An alternative could be that we keep the length consistent to the |
As shown above for our two masked input fields (phone number and SSN), when the user tries to edit the input in front of the final hyphen, unexpected behavior occurs. Deleting a digit pushes the cursor to the end of the input. Entering a new digit seems to work, but is jarring because the cursor once again gets pushed to the end of the input.
This unexpected behavior does not occur when editing digits after the final hyphen.
The text was updated successfully, but these errors were encountered: