Repository navigation
Open
Labels
selectThese are issues that relate to the select component
Description
Demo of the options below: https://asdf.jarhar.com/filterableselectfocus.html
Terminology
- Real focus: DOM focus, i.e.
document.activeElement,:focus,:focus-visible. - Virtual focus: DOM focus stays in the text field and the browser marks an option as "active" for AT (like
aria-activedescendant). The option matches:active-option.
Questions
- When focus is in the text field, should arrow keys move virtual focus through the options, or should ArrowDown move real focus into the listbox?
- Should the listbox/options also be reachable with Tab, separately from the text field?
- Should you be able to select/toggle an option while real focus is in the text field? (This would have to be Enter, because Space types a space.)
At TPAC, the ARIA WG discussed this and Jamie Teh asked whether it makes sense for options to be reachable both through virtual focus from the text field and through real focus by tabbing into the listbox (Matt King called this a "dual focus" problem). My summary of that feedback.
Already agreed in ARIA (applies to Options 1 and 2): the text field is mapped as a plain text field (not a combobox) that controls the listbox. Virtual focus (aria-activedescendant) is only set after the user presses an arrow key, and it is cleared when the user edits the text or moves the caret (typing, Backspace, Left/Right, Home/End).
Options
Option 1: Virtual focus from the text field AND options can get real focus
- This is what the Chromium prototype does.
- Based on the ARIA feedback, this may be confusing for AT users.
- Authors need to style an option for both
:active-optionand:focus-visible, e.g.option:is(:active-option, :focus-visible).
Option 2: Virtual focus from the text field only; options can't get real focus
- This is how the GitHub labels picker works.
- ARIA feedback said it's hard to get back to the text field when using AT.
- Options can be
:active-option, but never:focus-visible. - Clicking an option keeps focus in the text field.
Option 3: Text field only filters; ArrowDown moves real focus to the first option
- Based on the ARIA feedback this seems like the best path, but I'm not sure that non-AT users or developers would like it.
:active-optiongoes away completely, so authors have less to think about.- Once focus is in the listbox, typed characters no longer go to the text field. Instead they do typeahead within the listbox. We could redirect typed characters (and Backspace) back to the text field instead, but that might be unexpected.
- Moving focus with the arrow keys does not change the selection (selection doesn't follow focus); Space/Enter selects.
- ArrowUp on the first option moves focus back to the text field.
Keyboard summary
| Key | Option 1 | Option 2 | Option 3 |
|---|---|---|---|
| ArrowDown in text field | Virtual focus to next option | Virtual focus to next option | Real focus to first option |
| Enter in text field | Select/toggle active option | Select/toggle active option | Nothing (form submission?) |
| Tab from text field | Into listbox | Past listbox | Into listbox |
| Printable chars in listbox | Typeahead | n/a | Typeahead or redirect to text field (TBD) |
| Click an option | Focus moves to option | Focus stays in text field | Focus moves to option |
Open questions
- Does anyone have strong feelings for or against any of these options?
Metadata
Metadata
Assignees
Labels
selectThese are issues that relate to the select component
Activity
smhigley commentedon Nov 12, 2026
I'd go for Option 1 -- I don't see a reason to keep a persistent listbox out of the tab order, but I'd be interested in other opinions on that.
Option 3 will 100% mess with voice control, and I think introduce a number of other edge case issues. It also won't scale well to multiline, which even if this component never touches is still something I think we want consistency for.
The other concern here for making a good screen reader experience is paying really close attention to where
aria-activedescendantis set and cleared based on user interaction. E.g. it has to be cleared whenever an interaction is related to the text input (typing, left/right arrows).One big question to figure out related to this is whether activedescendant is set as soon as there are matching results, or whether a different method like using notifications to announce "X results returned" is better, with activedescendant only getting set if the user arrows into the listbox.
css-meeting-bot commentedon Nov 12, 2026
The Open UI Community Group just discussed
Focus and keyboard behavior for filterable select, and agreed to the following:RESOLVED: stick with option 1 and carefully prototype activedescendant based on feedbackThe full IRC log of that discussion
<masonf> jarhar: we discussed this at TPAC, particularly the focus stuff<masonf> ...Chromium can focus the options while the text field actually has focus. Use tab key to go to the options.
<masonf> ...jcsteh said that was confusing. Just make the options normally focusable and not do active-descendant
<sarah> q+
<masonf> ...github picker is a bit confusing, it was said. Hard to get back to the text field.
<masonf> ...couple different options. There's a demo.
<masonf> ...{presents demo}
<masonf> ...interested in a developer point of view.
<masonf> ack sarah
<masonf> sarah: I talked to Jamie about this after the session (not trying to speak for him). Some concerns are about some details of active-descendant.
<masonf> ...would still love to get his direct feedback. Not as simple as "active-descendant is bad" though.
<masonf> ...option 3 will cause voice control issues.
<masonf> ...I foresee edge cases and lesser tested AT problems with option 3.
<masonf> ...even if it feels almost like active-descendant
<masonf> ...also think option 3 won't work when you have multi-line
<masonf> ...there are instances with multi-line with filtering or a popup, and want them to feel the same.
<masonf> ...I lean towards option 1.
<masonf> ...no reason not to have a persistent thing not in the tab order, so I skipped option 2.
<masonf> q?
<flackr> q+
<masonf> jarhar: to summarize, option 3 is bad because some ATs might break?
<masonf> sarah: yeah. For voice control especially. Behaves differently when focus is in text edit control.
<masonf> ...means you can't explore options and do text.
<masonf> ...even if you do some magic like forwarding keystrokes back to the text, still doesn't work.
<Matt_King> q+
<masonf> ack flackr
<masonf> flackr: I agree, option 1 is the best. Not from a11y perspective, but option 3 is weird for non-AT users also. Doesn't match how native platforms usually do this.
<masonf> ...caveat with option 1: up and down can only move the selection if the text is single line, not multi-line.
<masonf> sarah: it can be done, but it's definitely weird.
<masonf> jarhar: you mean the text field has line breaks, right?
<masonf> q?
<masonf> ack Matt
<masonf> Matt_King: When you said multi-line, I thought you meant something like "mentions" in Github. Type # and get a list.
<masonf> ...i.e. inside a multi-line.
<masonf> ...That is not the kind of multi-line experience we're talking about?
<masonf> flackr: I think the entire thing is a multi-line text input.
<masonf> ...your case is also an issue, but I think different.
<sarah> q?
<masonf> Matt_King: Sounds like different, ok. So option 1 vs. 3. Option 1 we have active-descendant - when does it get set?
<masonf> ...only after the user presses down arrow? Or some other trigger?
<masonf> jarhar: I'm realizing... this is a great question. I didn't address it. I implemented that it gets set after pressing down arrow.
<masonf> ...also got feedback at TPAC that this was a good idea.
<masonf> ...Github does it immediately, which is a bit weird.
<masonf> Matt_King: We can have active-descendant and selected be done separately. As soon as you type in the filter and matches appear, it's possible that you could auto-select an item, but not set active-descendant, so AT thinks that focus is in the text. AT can announce the selected item, but user can still read the text field. Pressing down arrow changes modes.
<masonf> ...from an AT user's point of view, that's equivalent to pressing Tab to get to the list.
<masonf> ...you can implement option 1 so that from an AT user's point of view it works just like option 3. I'd prefer that.
<masonf> ...Option 3 gives the desirable screen user experience. Maybe not other AT. But if option 1 works like 3 in that way, that's great.
<sarah> q+
<masonf> ack sarah
<sarah> q-
<masonf> sarah: I was typing roughly that into the issue. Because active-descendant changes function just like focus changes, you can make option 1 feel like option 3, for a desktop screen reader user in focus mode.
<masonf> ...any user interaction that is related to text input (home end, left right), you clear active-descendant, to go back to text mode.
<masonf> ...do you set active-descendant as soon as there's a match? Or fire some notification that there are N results.
<masonf> ...lots of nuance for what thing you're building.
<masonf> jarhar: I'm heading option 1 is the best, and we carefully use active-descendant then it'll be a good experience. Right?
<masonf> Matt_King: yes.
<masonf> ...all about active-descendant being controlled by keyboard events, and nothing else. Let other aria attributes like selected be controlled elsewhere.
<masonf> ...not changing active-descendant based on events in the listbox would be good.
<masonf> jarhar: I'll need to wrap my head around the nuances there, but maybe I'll wait for Sarah's comment to clarify this.
<masonf> sarah: thumbs-up
<masonf> Marat: not in context here. But I anticipate a bunch of corner case usability with any of these options. If you move actual focus, generally that's bad.
<masonf> ...non-screen reader users, you type a few letters, move focus to list item, then want to type more letters, you need to move focus back.
<masonf> ...second part for screen reader user, as you type, component must provide what is changing in the list. I.e. from 10 to 3 items.
<masonf> ...usability corner cases. Try to prototype as much as possible.
<sarah> q+
<masonf> ...and test with users.
<masonf> ack sarah
<masonf> sarah: I've run user studies on exactly this, with a grid being filtered, but I didn't want to bring this up as an answer. As a provisional possibility, I like notifications rather than active-descendant. The former tells people, the latter moves focus.
<masonf> ...notifications seem better but low confidence in that.
<masonf> Matt_King: with high confidence, I can say you're right. Activedescendant means you can't read the text any more.
<masonf> ...so aria-notify is great, possibly on a slight delay. Need to experiment.
<masonf> sarah: I experimented with that. 0.5s looked pretty good for a typing debounce.
<masonf> Matt_King: you need some reasonable default.
<masonf> jarhar: how long before - that's so it doesn't announce for every character, right?
<masonf> Matt_King: some people can hear the keys they type, you don't want your announcement to break that.
<masonf> ...time it takes to announce a character is <0.5s definitely.
<masonf> jarhar: I've got a good idea of what to prototype.
<masonf> ...will stick with option 1.
<masonf> ...prototype doesn't use active-descendant, so I'll modify that. Set when arrowing. Clear when you go back to text. Etc.
<jarhar> proposed resolution: stick with option 1 and carefully prototype activedescendant based on feedback
<sbender> +1
<Matt_King> +1
<masonf> RESOLVED: stick with option 1 and carefully prototype activedescendant based on feedback
josepharhar commentedon Nov 20, 2026
Thanks for the discussion, I am implementing option 1.
One thing that I'm not certain about is whether :active-option should start matching the first option as soon as the text field is focused, as opposed to the active descendant behavior which should not start happening until the user presses arrow keys. On github, the first option is always highlighted and can always be activated by pressing enter without having to use the arrow keys, and presumably this is something that sighted users like. This might be bad for screen reader users though because they dont know that the first option is ready to be selected with enter or what the first option actually is, and when pressing down arrow to start the active descendant mode, it will actually make the second option become selected/active instead of the first option.
For now I'm prototyping making it so that :active-option doesn't get set at all on focus and it waits until down arrow so that :active-option always matches active descendant, but I'd like to hear more feedback on this.
sb3nder commentedon Nov 20, 2026
I like this, as it seems consistent with other places where active descendant is used, like comboboxes and search inputs.
[EDIT] Though, I wouldn't be able to say why using aria-activedescendant or ARIA notify on focus is bad, so take what I said with a grain of salt.
Is the reason for having :active-option match the first option that, if you press Enter on the input, you select the first option? Or is there another reason?Maybe it would be confusing for screen reader users if Enter selects the first option without them knowing beforehand what they're selecting?oh my bad, I read only part of the message... 😊