-
Notifications
You must be signed in to change notification settings - Fork 693
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
[selectors] :focusable
pseudo-class
#7269
Comments
I would also swear I have seen this discussed both in this context and probably linked to the focus metabug or related issues. One problem (I'm sad to write this) is "what does focusability mean" is not 100% clear. Things can be in sequential focus order, they can be focusable with a pointer, programatically focusable, that can vary by browser (one reason this might be nice to figure out) --- but even after that all of those things are just potential candidates, because whether something is actually focusable in any of those is ultimately determined by whether it is actually displayed too (and probably other things). So, it kind of seems to raise a lot of questions beyond just being a simple alias.... I'd be very interested in seeing some proposals around this sort of thing tho because focus is pretty messy. |
My (perhaps naive) expectation is that it would mean whatever is necessary so that if I called the |
That would imply that something that was |
FWIW, my expectation was similar to what @jimmyfrasche described above.
It shouldn't. We already have proposals [1, 2] where focusability is affected via CSS properties. |
If it can't include/exclude everything then Related, maybe 90% of my focus woes would be fixed by a javascript api that let me focus the element that the user would land on if they hit tab/shift+tab if focus was on a particular element so I could move focus off my component without having to know about the world outside its perimeter, something like |
This seems problematic due to circularities like Also, in Blink So |
Yeah, also in all browsers |
(And scrollers are focusable by keyboard iff they are scrollable, so that would be another source of circularity) |
In my practice, I would probably need to only be the “alias”, so something like It could be defined as something that could be focusable when there are no styles applied, basically, browser would need to only look at the HTML of an element, and don't do anything with styles. More to that — in my use-cases the |
What about The
|
That's an interesting idea. Whether it's a good path forwards depends on the use cases for targeting focusable elements. Do we have a list of use cases? |
If this existed one thing I'd use it for would be quick debugging css ( |
In some cases, need custom tab navigation focus, so need to know which element is focusable. A difficult case is the keyboard-focusable scroll containers.
It's hard to make it compatible with browsers support it or not. |
I was reading this article and I reached this gem:
Authors should not have to do all this just to target focusable elements (not to mention even this won't catch some…). Adding a pseudo-class for focusability seems like pretty low-hanging fruit (so low-hanging that I'd swear I've seen it discussed before, but I couldn't find anything so…)
The text was updated successfully, but these errors were encountered: