Open alice opened 4 years ago
From @rakina, some starting points:
https://blog.whatwg.org/focusing-on-focus https://github.com/whatwg/html/issues/4607
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:
tabIndex
attribute whether an element is unfocusable, or is only programmatically focusableI began some work to explore the needs which tabindex=-1
is attempting to address in https://github.com/WICG/webcomponents/issues/762#issuecomment-692416176, 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.
@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?
@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.
There has been work recently, e.g. https://github.com/whatwg/html/pull/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.