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
Focus-related behavior for <option>s inside a <select>. #82
Comments
Thanks for raising this and I agree with your conclusion. I also agree with back compat concerns, from a webplat perspective but as it relates to Open UI I think we should define what makes the most sense for a |
While I can't think of any potential issues for this, @alice are you aware of any potential issues for allow focus APIs to work on the |
What would calling I see that in Chrome currently an It seems like |
@alice you're correct, |
As far as I can tell, allowing Thanks @alice for pointing out that
I agree, I don't see any critical use cases here, although maybe a developer of a more complex custom |
Could you possibly point me to the discussion around allowing slotting |
@alice we're actively working out a solution currently which is where these questions are rising from. We do not have a fully formal proposal for that from a web platform perspective specifically but this anatomy and the general question does apply whether the web platform allows it or if its being implemented in JS for a component library. |
This was discussed on the most recent telecon. Here is the resolution.
|
There hasn't been any discussion on this issue for a while, so we're marking it as stale. If you choose to kick off the discussion again, we'll remove the 'stale' label. |
Closing as this issue was resolved in a telecon |
DOM focus doesn't function normally for
<option>
s under<select>
as implemented today.Calling
focus()
on an<option>
under a<select>
does nothing. Setting atabindex
on an<option>
under a<select>
has no effect on tab order. An<option>
under a<select>
never matches the:focus
pseudo-class even if it is the currently selected option. Thedocument.activeElement
can be the<select>
but never one of its child<option>
s.Do we want to change some of this behavior? It could be odd if
<option>
still has these unique lack of interaction with normal document focus if an<option>
can be slotted along with normal<div>
s etc that can be focusable in a normal way. It could also be useful for the developer to be able to do things like programatically callfocus()
on a given option as if it were any other element.For example:
It would be strange if the
<option>
s behaved differently from the<div>
with respect to focus,activeElement
,:focus
etc.There is of course a backwards-compatibility problem here, although a potential opt-in mechanism for all new behaviors might deserve its own Issue thread.
The text was updated successfully, but these errors were encountered: