-
Notifications
You must be signed in to change notification settings - Fork 12
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
NumberSpinner should behave like NumberPicker for keyboard navigation #318
Comments
I worked on this, basically copying the implementation from NumberPicker. There the component is an input of type "number." I think that this works pretty well. A few comments:
Surrounding the whole component makes much more sense here.
@terracoda @emily-phet @jessegreenberg what do you think? |
@zepumph, typically with a input type number, the actual box is editable, so the Left and Right Arrows are reserved to move within the number to edit it. The Up and Down Arrows are for increasing and decreasing. Since we don't have an editable box, and in some cases the arrows display horizontally, it would make sense in our case to enable all the arrow keys for for increasing and decreasing changing the value of the number. I think this would be a custom implementation based on what is in the ARIA 1.1 Specification. It seems silly, however, that it is not a default option in the case that the actual number box is not editable. It works nicely in RPAL. |
I can't speak to phet's relationship to editable components, but I feel like we just don't use them, not sure why. Perhaps @ariel-phet could speak to that. As for the "custom" interaction of adapting the left/right arrows to do the same as the up/down ones. I think that would be a good improvement. |
@jessegreenberg please review the below commit. I had to use a different event (keydown) since the input event isn't called with left/right with a number input. How does that look? |
@zepumph, @mbarlow12 and I decided to try the mixin pattern we used in HSlider to add accessibility to NumberPicker and NumberSpinner with the same implementation. I had forgotten about this issue, but would you mind reviewing AccessibleNumberTweaker since you took the lead on this issue? The highlight surrounds the whole input as you suggest in #318 (comment). |
A few thoughts:
This is really nice! It makes the usage so streamlined and simple. Well done @jessegreenberg and @mbarlow12. |
I renamed the options and Emitters as recommended in #318 (comment). Closing. |
In NumberPicker, the focus highlight goes around the buttons and the arrow keys can be used to increment/decrement the values. NumberSpinner should behave the same way. The focus highlight should go around the arrow buttons and not include the readout.
The text was updated successfully, but these errors were encountered: