-
Notifications
You must be signed in to change notification settings - Fork 6
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
NumberControl: How do constrainValue, delta, and shiftKeyboardStep work together? #528
Comments
What do you think about changing the interval of constrainValue: v => {
const interval = this.numberControl.slider.shiftKeyDown ? 1 : 10;
return Util.roundToInterval( v, interval );
}, Alternatively, arrow tweakers in NumberControl don't call constrainValue but round to the delta of the arrow button. Maybe we should do that in AccessibleValueHandler - when shift key is down, we round to nearest |
We took a look at this today. Overall, we are not thrilled with the implementation in NumberControl using However, I did try the |
This issue is kinda an example of how NumberControl is more than just a single PhET implementation of a Slider. We want to provide constraint to the slider to round by 10, but we want to be able to provide finer specificity with the shift key down. To me this is close to redefining constrainValue, giving shiftKeyStep a backdoor around that constraint. Maybe if we just expanded the API for Slider somehow, this could be fixed. It seems that a separate issue altogether is how to support visual pressing of the arrow buttons when shift key is pressed. That feels lesser than the first problem I outlined. |
Assigning for comment. |
@zepumph and I discussed this on 9/24/19. We decided on 3 action steps given the current state of this issue:
|
This blocks publication because it is breaking NumberControl shift keyboard step. Any sim with alternative input using a NumberControl should wait for this one (like GFL). |
@terracoda and I discussed this, and we think that styling the tweakers isn't very important for accessibility. We think there are two alternatives that we could do instead:
Having discussed with @jessegreenberg earlier, I think he will also like option (1). Please let me know if that isn't the case. After we implement this, as well as fix the shift keyboard step, we think it will be good to run it past a visual designer to get their thoughts. |
…er" in AccessibleValueHandler, phetsims/scenery-phet#528
@jessegreenberg, @emily-phet, and I discussed this earlier today, and we agreed to go with (1) from above for now. @twant and I implemented this in the above commits. It felt really good to delete the code that was reaching into AccessibleValueHandler, and to instead just have to pass the @jessegreenberg please review. |
Assigned to @jessegreenberg for review for 16 months. Raising priority to high. @jessegreenberg when can you get to this? |
This looks great. I had forgotten that we used to actually click the tweaker buttons to accomplish this, this change is much better. |
From phetsims/gravity-force-lab#173, the request was that the slider moved by 10, and the tweakers moved by 1. The issue as it pertains to a11y is that there is no a11y for the tweakers, everything interfaced through the slider. So adding "
constrainValue
to 10" there makes it impossible to move the slider by 1.@jessegreenberg how should we remedy this? The naive and bad way to fix this is to stop trying to have the a11y interaction deviate from the visual interaction. Then we could just click the buttons. But I'm not convinced that is best just yet.
The text was updated successfully, but these errors were encountered: