Skip to content

feat(Select): add aria-label prop and printable-char typeahead to SelectActivator - #635

Open
sridhar-3009 wants to merge 3 commits into
vuetifyjs:devfrom
sridhar-3009:fix/select-aria-label-typeahead-613
Open

feat(Select): add aria-label prop and printable-char typeahead to SelectActivator#635
sridhar-3009 wants to merge 3 commits into
vuetifyjs:devfrom
sridhar-3009:fix/select-aria-label-typeahead-613

Conversation

@sridhar-3009

Copy link
Copy Markdown
Contributor

SelectActivator is a combobox trigger but had no way to carry an accessible label when the visible label is in a sibling element, and no typeahead for keyboard users. This closes both gaps.

Changes

packages/0/src/components/Select/SelectActivator.vue

  • New optional label prop → emitted as aria-label on the activator (passed through to SelectActivatorProps / SelectActivatorSlotProps.attrs)
  • In onKeydown, when the listbox is open and a printable character key is pressed (single char, no Ctrl/Meta/Alt modifier), delegates to context.virtualFocus.typeahead(e.key) — jumps virtual focus to the first non-disabled item whose text content starts with that character

packages/0/src/composables/useVirtualFocus/index.ts

  • New typeahead(char: string) => void method on VirtualFocusReturn (interface + implementation)
  • Searches all non-disabled items starting from the position after the currently highlighted one (wrapping around), finds the first whose visible text starts with the typed char (case-insensitive), and calls highlight() on it

WCAG coverage

  • 2.1.1 Keyboard — printable-char typeahead is required for listboxes per ARIA authoring practice (APG Listbox pattern §6.5)
  • 4.1.2 Name, Role, Valuearia-label on the combobox satisfies the accessible name requirement when the label element is not associated via <label for>

Closes #613.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Changeset found — this change will be included in the next release. Thanks!

Add browser tests for SelectActivator.label (aria-label prop) and the
typeahead keyboard handler that delegates to useVirtualFocus.typeahead.

The typeahead test mounts with attachTo: document.body so that items are
in the live document and document.querySelector resolves element refs,
which is required for applyHighlight to succeed.

Add unit tests for useVirtualFocus.typeahead: forward search from current
position, case-insensitive matching, wrap-around, disabled item skipping,
no-match no-op, all-disabled early return, and el-less item handling.
@johnleider
johnleider changed the base branch from master to dev July 23, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Provider Items ship a partial ARIA contract: aria-selected without a role, no keyboard path

2 participants