fix(a11y): add accessible labels to icon-only controls#50
Open
msmps wants to merge 4 commits intocloudflare:mainfrom
Open
fix(a11y): add accessible labels to icon-only controls#50msmps wants to merge 4 commits intocloudflare:mainfrom
msmps wants to merge 4 commits intocloudflare:mainfrom
Conversation
commit: |
Contributor
Docs PreviewCommit: |
mattrothenberg
requested changes
Feb 26, 2026
Contributor
geoquant
requested changes
Mar 3, 2026
Collaborator
geoquant
left a comment
There was a problem hiding this comment.
Thanks for the contribution — the a11y gaps you identified are real and the fix direction is correct. Merge conflict is now resolved. A few changes needed before this can land:
1. Make labels configurable props (per @mattrothenberg's feedback)
Hardcoded English strings prevent i18n. Each label should be a prop with an English default.
TriggerInput:
function TriggerInput({
clearLabel = "Clear selection",
showOptionsLabel = "Show options",
...props
}: ComboboxBase.Input.Props & {
/** Accessible label for the clear button. @default "Clear selection" */
clearLabel?: string;
/** Accessible label for the dropdown trigger. @default "Show options" */
showOptionsLabel?: string;
}) {
// ...
<ComboboxBase.Clear aria-label={clearLabel} ...>
<ComboboxBase.Trigger aria-label={showOptionsLabel} ...>
}Chip:
function Chip({
removeLabel = "Remove",
...props
}: ComboboxBase.Chip.Props & {
/** Accessible label for the chip remove button. @default "Remove" */
removeLabel?: string;
}) {
// ...
<ComboboxBase.ChipRemove aria-label={removeLabel} ...>
}2. Chip label wording
Change "Remove selection" → "Remove". In chip context, the chip is the selection — "Remove selection" is ambiguous when there are multiple chips.
3. MenuBar — looks good as-is
aria-label={tooltip} on the icon-only button is correct and necessary — the Tooltip component provides aria-describedby (supplementary), not aria-label (name). No change needed here.
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
MenuBarandComboboxProblem
Several icon-only controls were missing explicit accessible labels, so screen readers could announce them as unlabeled buttons.
Controls:
MenuBaroption buttons (icon-only)Combobox.TriggerInputclear buttonCombobox.TriggerInputdropdown trigger buttonCombobox.ChipRemovebutton in multi-select chipsSolution
Add
aria-labelto each icon-only control: