-
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
Slider value only spoken when keyboard focused #72
Comments
Witnessed on FF and Chrome with NVDA. |
Thanks @zepumph, this is actually a known problem with our current parallel DOM implementation. The screen reader requires CSS bounds to handle mouse and touch interaction. Since the accessible DOM is hidden, it doesn't know that we are touching the slider. This is the exact same reason that our sims are not accessible on mobile VoiceOver. There is hope that someday we can support this kind of interaction on these platforms. But it would take some investigation on how to do it. I would say that it is up to @emily-phet and @terracoda for whether we need a workaround for sliders. We could potentially look into an alternative solution so that it always comes through (again, would likely mean not using |
Is there a way that we could fix this internally? Perhaps in accessibleInputListener, we are able to transfer over (to the PDOM) mouse events correctly similar to how we do that for keyboard events? Maybe I don't understand accessibility enough, and that is unrealistic or not thought through. |
That is a really interesting idea, I hadn't thought of that. Scenery's input listener would need to create a mock mouse/touch event whose target would the the PDOM element. Is that possible? Not sure if scenery can do that, and I don't know if DOM allows fake mouse events. |
Maybe something like this? https://developer.mozilla.org/samples/domref/dispatchEvent.html |
@zepumph, this isn't working yet, but I am wondering about something like this? https://jsfiddle.net/mk63j417/5/ In HSlider drag handler, we would create an event and dispatch it to the accessible DOM element. "click" event might be why it isn't working, maybe we can use another event. But when I test with NVDA, i still don't hear the aria-valuetext. |
https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent I see a big 👎 :( maybe there is a better approach. But I think we should hear from @emily-phet before spending more time as this will be an investigation. |
@jessegreenberg and @zepumph this is a very interesting issue. When I first imagined how the PDOM would be implemented, I thought it would be directly on top of the visual sim, but in reality it is off screen, off to the side. I agree, there is no easy answer at the moment. |
I looked into this a bit more. @jessegreenberg it seems like var |
When scenery starts processing inputs on the 2nd slider, can we just set the focus to the second slider programmatically? |
I would think so, we can always manually set focusHighlight to a node. see |
Even better to set focus to the DOM element with |
That sounds reasonable. I would want @jessegreenberg's opinion about bypassing the accessibility mixin there. Potentially they could do the same thing? |
Ill give it a shot! We would make the focus highlight invisible while interacting with the slider with mouse/keyboard so it doesn't interfere for all interaction. The question is whether or not focus is enough to read the aria-valuetext or if the screen reader requires a keydown or input event to read the new value. |
I guess we probably want two types of keyboard focus. The normal way and a 'silent' way.
Too true. It also seems like we want to make sure that this doesn't mess up the current sound of descriptions. |
When focusing on the |
In order for it to work with NVDA, we need to focus the slider on |
I wonder how important this problem is. I tried to tackle it today and found that you can't drag a thumb with the mouse when that slider is focused. @jessegreenberg you were right though, it sounded nice on NVDA to focus on The reason I don't think that we should spend too much time on this is because the focusHighlight pops up. I'm not sure how to handle that, and I'm not sure that this is a priority. Unassigning for now. |
@jessegreenberg and I discussed, and think this discussion should be moved to a11y-research repo. |
This issue was moved to a11y-research, referenced in phetsims/a11y-research#69. Closing this issue since it will be discussed generally for all sims there. |
I noticed this in the sonification wrapper and on master. When using the keyboard or mouse to move a slider that is highlighted with keyboard focus, the Screen Reader will state the change, but if you use the mouse on the other slider when the first slider still has focus on it, then it will not alert. It will also not alert at all when just using the mouse with no highlight anywhere.
The text was updated successfully, but these errors were encountered: