[WC-3418] Combobox accessibility improvements#2281
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
0d5657e to
d1fded1
Compare
AI Code Review
What was reviewed
Skipped (out of scope): Findings🔶 Medium —
|
| aria-label={ | ||
| !isOpen && selectedItems.length > 0 && hasLabel | ||
| ? `${labelText}, ${selectedItems.map(id => selector.caption.get(id)).join(", ")}` | ||
| : !isOpen && selectedItems.length > 0 | ||
| ? selectedItems.map(id => selector.caption.get(id)).join(", ") | ||
| : !hasLabel | ||
| ? options.ariaLabel | ||
| : undefined | ||
| } | ||
| aria-labelledby={hasLabel && isOpen ? inputProps["aria-labelledby"] : undefined} |
There was a problem hiding this comment.
I believe we better create a helper function that covers this, also as AI review mentioned, there is a logic error where in empty it will have no label at all, we should address this in a helper function that we can unit test.
Pull request type
Bug fix (non-breaking change which fixes an issue)
Description
Fixes two WCAG accessibility violations in the combobox widget.
aria-hidden="true"to DownArrow and ClearButton icon wrappers to prevent "image" announcements<ul>now only renders when open, preventing screen readers from navigating to empty groupsWhat should be covered while testing?
Screen Reader Testing:
Functional Testing: