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

Review the HTML spec's treatment of focus #468

Open
alice opened this issue Jan 27, 2020 · 6 comments
Open

Review the HTML spec's treatment of focus #468

alice opened this issue Jan 27, 2020 · 6 comments

Comments

@alice
Copy link

alice commented Jan 27, 2020

There has been work recently, e.g. whatwg/html#4754, to give the HTML spec a more consistent handling of focus.

We should check what the status of that work is, whether it is being tracked in a single place, and review the work as a complete set once it's done.

@alice
Copy link
Author

alice commented Jan 28, 2020

From @rakina, some starting points:

https://blog.whatwg.org/focusing-on-focus
whatwg/html#4607

@alice
Copy link
Author

alice commented Mar 2, 2020

See also: WICG/webcomponents#762

@alice
Copy link
Author

alice commented Mar 2, 2020

See also: whatwg/html#5326

@alice
Copy link
Author

alice commented Jan 26, 2021

Looking at this in our virtual face to face just now, I have some relatively unstructured thoughts:

If we were adding keyboards as a new usage mode on the web today (as a highly unlikely counterfactual), we would suggest writing an explainer outlining the user needs, the platform constraints, and how the proposed design meets those user needs. It seems like the work done on focus in the HTML spec has only outlined the (no longer proposed, but factual) design, without explaining how it fits together, documenting any regrettable decisions, or any user needs which should be taken into account when designing additions to the system.

In particular, the decision to have :focus match on unfocusable shadow hosts when the "actual" focused element is inside a shadow root seems to have made a priority of constituencies trade-off in the dispreferred direction: in order to avoid potentially revealing the existence of a shadow root (theoretical purity, or at best convenience for developers), it shows a focus highlight by default on the shadow host, creating a confusing experience for users.

A much older feature, tabindex=-1, also has some regrettable aspects:

  • It is impossible to tell from the IDL tabIndex attribute whether an element is unfocusable, or is only programmatically focusable
  • It causes the element to be focused on click, which is useful in some but not all cases.

I began some work to explore the needs which tabindex=-1 is attempting to address in WICG/webcomponents#762 (comment), but it would be good to have a full-fledged "focus on the web" explainer which explains in terms of user needs, rather than simply explaining the state of the spec right now.

@hober
Copy link
Contributor

hober commented Jul 27, 2022

@alice wrote:

but it would be good to have a full-fledged "focus on the web" explainer which explains in terms of user needs, rather than simply explaining the state of the spec right now.

Do you think the TAG should be trying to find someone in the community (@rakina, maybe, or someone from WAI) to write such an explainer?

@atanassov
Copy link

@travisleithead (nudge :)) could also help us make progress on this given his experience in both DOM and accessibility space. Or help find someone who could offer some time for this.

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

No branches or pull requests

7 participants