-
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
Remove timeout from ButtonModel a11yClick #371
Comments
Maybe @jonathanolson has insight, we can try to talk about this issue too tomorrow with him, when we meet for phetsims/scenery#831 |
After more discussion in phetsims/scenery#831, we are going to try to use PressListener for a11y. Since the implementation will be in that type, we can better handle cases like the one the motivated this issue originally. Because of that, we decided that we should proceed with the timeout because it generally handles the input from AT in the most general way. @zepumph I am going to close this issue, but feel free to reopen if you think there is more to discuss here. |
Actually I'm still unsure about this, the error we were getting on Wednesday is all about how the timer was delaying, async, too long, so we got weird logic where the dialog and phetmenu were both showing. I'm not yet clear how phetsims/scenery#831 could solve that. |
This is handled as part of phetsims/scenery#831. Closing |
a11yClick was introduced as a way to implement accessibility in the button model. Motivated originally by #323. When using a screen reader or assistive device, clicking a button with the keyboard often doesn't register a
keydown
andkeyup
event, rather the user agent sends a singleclick
event to the browser.Because of this, we update the
overProperty
anddownProperty
using a timeout to update the look of the button and fire the listeners from the only event that we have access too.But of course this timeout is causing problems. Particularly, we are running into a case using ?fuzzBoard where a Dialog can be closed and open again before being fully hidden, and so we are adding the same listeners to the open dialog more than once. But the issue is not specific to Dialog.
This issue is related to phetsims/scenery#831, where we are seeing if we can leverage PressListener for accessibility. Either way, we would like to remove the timeout from ButtonModel. @zepumph and I brainstormed ways around this. One solution would be to handle
keydown
andkeyup
when those events are available, and falling back on click where necessary. An input listener might look likeWe might create this listener in a similar way to the current
ButtonModel.createListener
, so that a11y button functionality could be added to any node with a ButtonModel.The drawback to this approach is that when using an AT that does not send keydown/keyup events to the browser (like switch devices, some gesture input, and maybe even JAWS - need to test) we won't see the button look pressed, it will fire but look flat.
The text was updated successfully, but these errors were encountered: