-
Notifications
You must be signed in to change notification settings - Fork 13
Added code and test to clear selected field using backspace #52
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: master
Are you sure you want to change the base?
Added code and test to clear selected field using backspace #52
Conversation
Is this a normal behavior in selects ? Can you cite some examples that have this behavior ? Also, the |
Yes. Actually it's a common practice to have valid keyboard alternatives to meet accessibility standards. For our case, just clearing the selected field using keyboard was missing. Example: https://jedwatson.github.io/react-select/ And yes, disabled check is a good catch. Thanks. |
@selvagsz I have added the check and also a test case, just in case. |
@selvagsz sorry to bother you again, did you have a chance to look at this PR ? I have a dependency on this little functionality. Thanks! |
We have But with backspace, this gets bypassed as well I'm still unsure whether this behavior should respect Though I hate to increase the api surface. |
However, you can achieve the same functionality by composing the component & handling the keyDown event. I'd prefer to wait for more feedbacks on this feature |
No worries. Thanks for letting me know. On another note. The TetherComponent changes are merged, so when can I expect the next release ? |
So, the way I see it, backspace is just an alternate way of clearing the selected field. So any scenario where you should not be able to clear the selected field, the backspace should honour that. I am making the changes right now to not bypass the showClear flag. Since you know the api best, let me know if you see any problem with that. Also, I don't believe there is a need to use another flag for this specifically as that will be confusing for the user. |
@Suvra1990 published 1.0.0-beta.15 🎉 |
Adding functionality to clear selected field using keyboard to support accessibility standards.
"Some people cannot use a mouse, including many older users with limited fine motor control. An accessible website does not rely on the mouse; it makes all functionality available from a keyboard."
source: https://www.w3.org/standards/webdesign/accessibility