Skip to content

docs(Select): fix double role=option in Item examples - #775

Merged
johnleider merged 1 commit into
masterfrom
docs/select-item-double-option-738
Aug 3, 2026
Merged

docs(Select): fix double role=option in Item examples#775
johnleider merged 1 commit into
masterfrom
docs/select-item-double-option-738

Conversation

@johnleider

Copy link
Copy Markdown
Member

Closes #738

The Select compound and Item @example blocks spread slot attrs onto an inner <div> inside a non-renderless Select.Item. The Item already binds those attrs (role="option", onClick) on its own Atom, so the documented usage rendered listbox > div[role=option] > div[role=option] — axe aria-required-parent (critical) — and double-fired the click handler. Fixed by putting content directly in the slot; the fixture and docs select examples already had the corrected shape.

Bug-family sweep

Checked every component binding slotProps.attrs on a non-renderless Atom for the same @example defect:

Same defect, fixed:

  • Combobox — both barrel @examples (compound + Item) had the identical inner-div spread; corrected the same way (Item highlight styling moved to a data-[highlighted] class on the component)
  • Treeview — Cue/Checkbox/Indicator/SelectAll @examples spread attrs without renderless; added renderless (matches the docs example precedent). Same fix for Treeview.Cue in apps/docs treeview basic.vue
  • RadioRadioGroup slot @example duplicated role="radiogroup"; RadioRoot slot @example spread attrs and re-bound select alongside attrs.onClick (triple-fire). Added renderless, dropped the redundant handler

Checked clean: Select/Combobox fixtures and all select/combobox docs examples (already corrected shape), Selection/Single/Group examples (pure context providers, no Atom), Presence (renderless by nature), Rating/Avatar/Image docs examples (already renderless).

Out of scope per issue: Select.Activator button-name (#613/#635) and the accessible-name mechanism (#610).

Verification

  • vitest --project v0:browser — a11y sweep + Select: 152 passed
  • pnpm typecheck — green

@johnleider johnleider added this to the v1.0.x milestone Aug 3, 2026
@johnleider johnleider added T: bug Something isn't working C: Select Select component labels Aug 3, 2026
@johnleider johnleider self-assigned this Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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

The Select compound and Item @examples spread slot attrs onto an inner
div inside a non-renderless Item. SelectItem already binds those attrs
(role=option, onClick) on its own Atom, so the documented usage rendered
listbox > div[role=option] > div[role=option] — axe aria-required-parent
(critical) — and double-fired the click handler.

Bug-family sweep of components binding slotProps.attrs on a
non-renderless Atom:

- Combobox: same defect in both @examples — same correction
- Treeview Cue/Checkbox/Indicator/SelectAll @examples and the docs
  treeview basic example spread attrs without renderless — added
  renderless
- Radio Group/Root slot @examples spread attrs (duplicate
  role=radiogroup; Root also re-bound select alongside attrs.onClick) —
  added renderless, dropped the redundant handler
- Clean: Selection/Single/Group/Presence examples (pure providers or
  renderless), Select/Combobox fixtures and docs examples

Closes #738
@johnleider
johnleider force-pushed the docs/select-item-double-option-738 branch from b3e561f to 5a609a3 Compare August 3, 2026 16:50
@johnleider
johnleider marked this pull request as ready for review August 3, 2026 16:51
@johnleider
johnleider merged commit 8191795 into master Aug 3, 2026
22 checks passed
@johnleider
johnleider deleted the docs/select-item-double-option-738 branch August 3, 2026 17:22
@github-actions github-actions Bot mentioned this pull request Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C: Select Select component T: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Select.Item renders role="option" twice — nested options have no required listbox parent

1 participant