Skip to content
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

Element activation and synthesized events #168

Open
chrisosaurus opened this issue Sep 2, 2020 · 2 comments
Open

Element activation and synthesized events #168

chrisosaurus opened this issue Sep 2, 2020 · 2 comments

Comments

@chrisosaurus
Copy link

chrisosaurus commented Sep 2, 2020

This came up when discussing synthesizing an event from AT to represent Activation in #166.

If you have an HTML button with focus then some keypresses (Enter, Space) will synthesize a Click event in addition to the keyboard event.

  1. Which elements have activation behaviors triggered by keyboard events ?
    1. What are these keyboard events ?
    2. Where is this specified ?
  2. Should this be generalized to support non-built-in elements, and if so, how ?
  3. How should this behave for synthesized activation events sent from AT ?
@chrisosaurus
Copy link
Author

Some existing elements and their behavior

Element behavior on Click behavior on Enter behavior on Space
<input type=’button’></input> Click event Click and Enter events Click and Space events
<div role=’button’></div> Click event Enter event Space event
<div></div> Click event Enter event Space event
<a href=’...’></a> Open link Open link Space event

@chrisosaurus
Copy link
Author

Related links:

Non-click activation behaviours must, by default, fire a Click event.
https://html.spec.whatwg.org/multipage/interaction.html#activation

The activation triggers for <a> elements are Click and Enter.
https://w3c.github.io/uievents/#event-flow-activation

Space and Enter dispatch a Click event when a state-changing element has focus.
https://w3c.github.io/uievents/#event-type-keydown

WHATWG bug “Need a consistent set of events that defines user activation”
whatwg/html#3849

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant