fix(Select, Combobox): correct the documented Item example to avoid double role=option - #765
Closed
sridhar-3009 wants to merge 1 commit into
Closed
Conversation
…ouble role=option
Member
|
Thanks — right diagnosis on #738. The merged fix (#775) took the other repair (dropping the inner element rather than adding renderless, so the documented shape has one option element and one click binding) and swept the same defect family through Radio, Treeview, and the Combobox examples. Since master's examples no longer have the inner spread at all, closing as superseded — and again, you were first; the duplicate was our miss. |
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.
Closes #738.
Select.Item(and, identically,Combobox.Item) binds its wholeattrsbundle — includingrole="option"— onto its ownAtom, which is notrenderlessby default. Both components'@exampleJSDoc then spread that sameattrsobject onto a child<div>inside the default slot:.claude/rules/components.mddocuments this as unsupported outsiderenderlessmode — spreadingattrsonto a child in non-renderless mode renders the ARIA role twice (listbox > div[role="option"] > div[role="option"], failing axe'saria-required-parent) and double-fires every handler inattrsonce on the child and again via bubbling to the Atom. The documented shape is exactly this bug.Fix
Added
renderlessto the documentedSelect.Item/Combobox.Itemusage in both components'@exampleblocks (the top-level module example and each component's own JSDoc), so the consumer's own element is the only one rendered. This matches howpackages/0/src/components/fixtures/Select.vue/Combobox.vueand every real docs example (apps/docs/src/examples/components/select/*,combobox/*) already use these components — none of them spreadattrson a child, so none were actually affected by the bug; only the documented@exampleshape was.Per the issue,
Combobox.Itemis structurally identical toSelect.Item(sameas='div'default, same non-renderlessattrsspread) and didn't appear in the #736 sweep only because the harness never got Combobox's listbox open to audit — checked it by hand here and it has the identical example bug, now fixed alongside Select.Documentation-only change; the fixture used by the a11y sweep was already correct, so all 53 existing
a11y.browser.test.tstests pass unchanged.