Repository navigation
fix(VCommandPalette): expose highlighted item to screen readers - #23258
Merged
Merged
Conversation
The search input keeps focus while the highlight moves, but only the listbox carried aria-activedescendant. The input is now a combobox that points at the highlighted option and the results list. VList exposes `activeDescendant` so the focused element can reference the tracked item. fixes #23257 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
MatthewAry
marked this pull request as ready for review
October 9, 2026 18:22
Contributor
Author
|
@J-Sek I hope this PR does not strike you as slop, but I openly admit that it was all done with AI. If you find that irritating, please let me know. I will be more involved if needed. |
- never reference subheaders or dividers as the active descendant - mark the tracked option as selected - keep aria-controls in sync when listProps sets an id - document the combobox semantics and the item slot Co-Authored-By: Claude Opus 5.5 <[email protected]>
J-Sek
approved these changes
Oct 13, 2026
Contributor
|
It's great that you are taking care of it. Hopefully we will start dogfooding it when the time comes to overhaul the docs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
fixes #23257
The search input keeps DOM focus while arrow keys move the highlight, but
aria-activedescendantwas only set on the listbox, which never has focus. Screen readers announced nothing while moving through results, so Enter ran a command the user never heard.The input now follows the editable combobox with list autocomplete pattern:
role="combobox",aria-autocomplete="list",aria-expanded,aria-controlspointing at the results list, andaria-activedescendantpointing at the highlighted option. With no results,aria-expandedisfalseandaria-controls/aria-activedescendantare dropped.Item ids come from VList's private
useId(), so VList now exposesactiveDescendant(the same value it already renders on its ownaria-activedescendant).The highlighted option also gets
aria-selected="true"undernavigationStrategy="track", as the pattern expects.activeDescendantnever points at a subheader or divider, and the palette no longer falls back to index 0 when nothing is selectable (Enter used to run on a subheader).Targeting
devbecause of the new exposed member. It's only there to make the fix possible, so amasterpatch is also defensible; maintainers' call.Deferred:
rolegoes through VTextField'sroleprop, same as VAutocomplete, so thev-fieldwrapper also getsrole="combobox". That's [Bug Report][3.9.5] v-combobox has duplicate "combobox" roles within the component #22098, fixed for all inputs by fix(VSelect, VAutocomplete, VCombobox): duplicated a11y attributes #22112; specs queryinput[role="combobox"]until then.inputslot gets neither these attributes nor keyboard handling. Documented here, fixed in a follow-up.aria-activedescendantis rendered onrole="list"(non-selectable tracked lists), and item ids restart per nested group. Neither affects the palette.Markup:
🤖 Generated with Claude Code