-
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 results in 2 calls to initializeAccessibleSlider #452
Comments
initializeAccessibleSlider
One line of thinking for this issue is if we should be able to "turn off" the call to HSlider's accessibleSlider initialization. Perhaps with an option? |
Agreed. @mbarlow12 mentioned over slack that another option could be to remove the initializeAccessibleSlider call from NumberControl. Using AccessibleSlider in NumberControl may not be necessary now that we have more control over a11y events in scenery. |
I tried a quick and dirty removal of initializeAccessibleSlider, it seems to be working OK. I want to test a few things before moving forward with this. But I also verified that removing the extra inputs fixed the original bug that was found in phetsims/coulombs-law#100 |
Actually, I don't think this is working because of changes in scenery input, which is good because that will make this far easier to patch in the coulombs-law release branch. |
I tested this in Chrome, FF, and Edge and the NumberControls are working in all three and I can no longer produce phetsims/coulombs-law#100. The arrow buttons and extra slider have been removed from the PDOM. Ill go ahead and commit. |
This is done and was merged into the release branch of CL. Closing. |
During 1/7/18 dev meeting @zepumph voiced concern that we removed AccessibleSlider from number control and kept all of the accessibility implementation in HSlider. Conceptually, the NumberControl behaves like a slider in the PDOM. But the entire a11y instrumentation comes from its child HSlider, so NumberControl's a11y code will be difficult to maintain. |
After further discussion, we think that phetsims/scenery#920 will cover this case well enough. Though it is still up for discussion, the fix here would be to just use the |
While the above fix handles the nested slider inputs, we're left with a PDOM representation that comes from a child node that's not public. In this case, if we need to update attributes or anything else about the PDOM from NumberControl or its parent(s) we're either force to expose the Node that handles the PDOM prepresentation (the slider in this case) or expose methods on NumberControl that manipulate the slider. |
One option proposed by @zepumph was to make the call to |
@mbarlow12 you added this in 6014b5e: // @public - expose setter for aria-valuetext for the slider
this.setAriaValueText = function( text ) {
slider.ariaValueText = text;
}; Should this be |
... and should this we called |
Having both the tweaker buttons and the slider in the navigation order is redundant because you can increment/decrement the Property by the tweaker button deltas by holding the shift modifier key on the keyboard. So it was decided that the tweaker buttons be removed from keyboard navigation and the entire NumberControl behave like a slider. |
Why does that require the NumberControl behaving like a slider? Why not have NumberControl remove the ArrowButtons from the navigation order, and then have the slider behave like a slider? And why is it necessary for the entire NumberControl to have focus, vs just the slider? As explained in #452 (comment), that will result in similar collections of controls not having this type of focus. NumberControl is an implementation detail for handling layout, it's not a UI control. |
@zepumph said:
Good to know. Also surprising that the design team doesn't seem to be interested in including the original designer/implementer (that would be me) in the loop. This is the first I've heard about it. That's an approach that you might want to reconsider. |
Right, that is what we initially did for this issue. But then we found that we will want the functions in AccessibleSlider to be available with each NumberControl. For example, on a NumberControl you can call
Yes I agree, that sounds great! |
Is this issue ready for close? I think everything has been implemented. Anyone feel free to reopen if there is more to discuss. |
@jessegreenberg and I are rethinking our previous decision on this issue, especially in light of #519. Reopening. |
Our proposal:
We think this addresses our concern for good api from #519, and also takes into account @pixelzoom's considerations about design patterns for composite components. @jessegreenberg will take on this change. Thanks! |
I think this also means we can remove the |
I don't think so. Let's get rid of it. |
This is done in the above commits. I reviewed sims in perennial/accessibility and couldn't find any sims using AccessibleValueHandler API through NumberControl. The original discussion around this was because we needed to set ariaValueText outside of NumberControl. But that function has since been removed as well. I left aqua tests are passing and I tested NumberControls with a keyboard to make sure key strokes still work. @zepumph could you please review? |
Review:
@jessegreenberg please review |
Thank you, good catch. And thanks for checking the other things. With that, I think this can be closed, please reopen if you disagree. |
From phetsims/coulombs-law#100, we've noticed that NumberControls don't handle focus properly (this also happens in Rutherford Scattering). This problem may lie in the fact that NumberControl calls
initializeAccessibleSlider
in its top level but also has a constituentHSlider
that makes the same call. What results is the following PDOM structure:I'm not sure if this is causing the odd focus issues, but we should likely investigate how we're constructing the PDOM in this scenario.
The text was updated successfully, but these errors were encountered: