-
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
branch: catchSingleClick #945
Comments
In the branch, most of the implementation for this is in A11yEventCatcher (hopefully to be renamed to something better). |
@zepumph and I had discussed trying alternatives to creating native DOM events and dispatching/firing through the DOM API. This was OK for test code, but doesn't seem good for sims. I tried to use Input.serializeDOMEvent (previously added for PhET-iO) to create an event like object that we can pass through Input.js. But we will need to add additional information to that function to get all keydown properties. I am not saying that isn't possible, but I don't want to add things to that function yet. For exploration now, I will just make my own object that has the data of a a EDIT: I did that and hit an assertion:
Because EDIT2: Going back to trying Input.serializeDOMEvent/deserializeDOMEvent, but wonder if I will run into issues because I want to change properties like EDIT3: Yes, I received
EDIT4: The |
This is working well enough that I think it is a viable possibility. I will report back in #939 |
See #939 (comment) for a summary of these changes. Pending further discussion in that issue. |
A branch to try a solution for #939. In that issue we are trying to solve the problem that assistive devices often do not send
keydown
andkeyup
events to the browser, but onlyclick
events to represent element activation.As a potential solution to this, I am considering no longer dispatching
click
as a scenery event and instead only dispatchingkeydown
andkeyup
for a11y input. The idea is that if we receive a click event, we check for keydown/keyup events that were triggered on the same target. If we receive keydown/keyup events we can do nothing. But if we did not receive them, we send our own fake events to mimickeydown
andkeyup
.This way, we can support all of the options that work generally for PhET buttons (#939 (comment)) and also support native HTML and typical ARIA roles for activatable elements buttons, links, check boxes, and so on.
The text was updated successfully, but these errors were encountered: