Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5f740e3
Checkbox: Fix missing visible label a11y issue in stories
i-am-chitti Aug 18, 2026
9bab17e
Input: Fix missing visible label a11y issue in WithSuffixControl story
i-am-chitti Aug 18, 2026
e2409ce
Merge branch 'trunk' of github.com:i-am-chitti/gutenberg into fix/815…
i-am-chitti Aug 20, 2026
bf9eee3
UI: Fix placeholder contrast on Select and Combobox triggers
i-am-chitti Aug 20, 2026
87d53fa
Combobox: Name the detached inline listbox in its story
i-am-chitti Aug 20, 2026
aa0e34f
Checkbox: Use the plain label variant and row layout in stories
i-am-chitti Aug 20, 2026
556c6de
UI: Add changelog PR link for the placeholder contrast fix
i-am-chitti Aug 20, 2026
8ee6950
Merge branch 'trunk' of github.com:i-am-chitti/gutenberg into fix/815…
i-am-chitti Aug 21, 2026
3a9b0cd
UI: Scope the trigger placeholder color to enabled triggers
i-am-chitti Aug 22, 2026
018da85
Autocomplete: Stop rendering aria-orientation in grid mode
i-am-chitti Aug 22, 2026
01ae8f9
Revert Checkbox and Input story labeling changes
i-am-chitti Aug 22, 2026
6a2fa14
Autocomplete, Combobox: Fix inline story accessibility annotations
i-am-chitti Aug 22, 2026
37908c5
UI: Add changelog entries for the accessibility fixes
i-am-chitti Aug 22, 2026
5dde813
Merge branch 'trunk' into fix/81596-a11y-ui-stories
i-am-chitti Aug 22, 2026
415038a
UI: Fix the inline combobox composition and update story accessibilit…
i-am-chitti Aug 22, 2026
e95b1d8
Merge branch 'trunk' into fix/81596-a11y-ui-stories
i-am-chitti Aug 24, 2026
94913fa
UI: Use the interactive token for the trigger placeholder color
i-am-chitti Aug 25, 2026
8514ac5
Autocomplete: Point the aria-orientation workaround at the Base UI 1.…
i-am-chitti Aug 25, 2026
d8eb3b2
Combobox: Name the detached inline input and enforce its a11y check
i-am-chitti Aug 25, 2026
cf5ec95
UI: Point the Autocomplete.List changelog entry at the correct upstre…
i-am-chitti Aug 25, 2026
73aeab5
Merge branch 'trunk' of github.com:i-am-chitti/gutenberg into fix/815…
i-am-chitti Aug 25, 2026
d3811c0
UI: Drop the external issue link from the Autocomplete.List changelog…
i-am-chitti Aug 25, 2026
06d6f33
Update packages/ui/src/form/primitives/combobox/stories/index.story.tsx
ciampo Aug 25, 2026
2565ed6
Update packages/ui/CHANGELOG.md
ciampo Aug 25, 2026
3e98c0d
Update packages/ui/CHANGELOG.md
ciampo Aug 25, 2026
251525d
Merge branch 'trunk' into fix/81596-a11y-ui-stories
ciampo Aug 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/ui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
- `Card`: Use the normal neutral surface stroke for the default border. ([#81746](https://github.com/WordPress/gutenberg/pull/81746))
- `Calendar`, `RangeCalendar`: Preserve day focus when a controlled month change removes the focused day. ([#81635](https://github.com/WordPress/gutenberg/pull/81635))
- `Button`: Fix the loading spinner being off-center in RTL ([#81901](https://github.com/WordPress/gutenberg/pull/81901)).
- `Select`, `Combobox`, `SelectControl`: Fix the trigger placeholder failing the 4.5:1 text contrast minimum ([#81853](https://github.com/WordPress/gutenberg/pull/81853)).
- `Autocomplete.List`: Stop rendering `aria-orientation` in grid mode, where `role="grid"` disallows it ([#81853](https://github.com/WordPress/gutenberg/pull/81853)).
- `SearchableChipSelect`, `SearchableChipSelectControl`: Forward ref to the search input instead of the chips container ([#80980](https://github.com/WordPress/gutenberg/pull/80980)).

### Documentation
Expand Down
4 changes: 4 additions & 0 deletions packages/ui/src/form/primitives/autocomplete/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export const List = forwardRef< HTMLDivElement, AutocompleteListProps >(
className={ clsx( itemPopupStyles.list, className ) }
ref={ ref }
{ ...restProps }
// `role="grid"` disallows `aria-orientation`, which Base UI
// renders regardless.
// TODO: safe to remove after updating to Base UI >= 1.8.0
aria-orientation={ undefined }
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,15 @@ export const AsyncItems: Story = {
*/
export const Inline: Story = {
parameters: {
// FIXME: Inline list has incomplete ARIA relationships and is not keyboard-accessible when scrollable (aria-required-attr/children/parent, aria-allowed-attr, scrollable-region-focusable).
// See: https://github.com/WordPress/gutenberg/issues/81596
a11y: { test: 'todo' },
// The input keeps focus and arrow keys move through the options, so
// the scrollable list is reachable by keyboard.
a11y: {
config: {
rules: [
{ id: 'scrollable-region-focusable', enabled: false },
],
},
},
},
args: {
items: COMMANDS,
Expand Down Expand Up @@ -528,8 +534,9 @@ function chunkItems< T >( items: T[], size: number ): T[][] {
*/
export const Grid: Story = {
parameters: {
// FIXME: Grid markup has incomplete ARIA relationships (aria-required-attr/children/parent, aria-allowed-attr).
// See: https://github.com/WordPress/gutenberg/issues/81596
// `role="grid"` disallows the `role="group"` children that Base UI
// renders (aria-required-children, aria-required-parent).
// TODO: Remove after updating to Base UI >= 1.8.0
a11y: { test: 'todo' },
},
args: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,5 +496,36 @@ describe( 'Autocomplete', () => {
expect( rowRef.current ).toBeInstanceOf( HTMLDivElement );
} );
} );

// TODO: Remove with the `Autocomplete.List` override after updating to Base UI >= 1.8.0
it( 'does not set `aria-orientation`, which `role="grid"` disallows', async () => {
render(
<Autocomplete.Root items={ GRID_ITEMS } grid inline open>
<Autocomplete.List>
{ ( group: ( typeof GRID_ITEMS )[ number ] ) => (
<Autocomplete.Group
key={ group.value }
items={ group.items }
>
<Autocomplete.Row>
{ group.items.map( ( item ) => (
<Autocomplete.Item
key={ item.value }
value={ item }
>
{ item.emoji }
</Autocomplete.Item>
) ) }
</Autocomplete.Row>
</Autocomplete.Group>
) }
</Autocomplete.List>
</Autocomplete.Root>
);

expect( await screen.findByRole( 'grid' ) ).not.toHaveAttribute(
'aria-orientation'
);
} );
} );
} );
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ const meta: Meta< typeof Combobox.Root > = {
'Combobox.Clear': Combobox.Clear,
},
parameters: {
// FIXME: Placeholder-like trigger text fails color-contrast (WCAG 1.4.3 applies to placeholder text). The trigger has no visible label and relies on aria-label (button-name). Detached Inline also lacks accessible names/required ARIA and uses a non-keyboard-accessible scroll region (aria-input-field-name, aria-required-attr, scrollable-region-focusable).
// FIXME: The trigger has no visible label and relies on aria-label
// (button-name).
// See: https://github.com/WordPress/gutenberg/issues/81596
a11y: { test: 'todo' },
componentStatus: {
Expand Down Expand Up @@ -118,12 +119,33 @@ export const Compact: Story = {
* To do this, omit the `Popup` and enable the `inline` prop on the `Root`.
*/
export const DetachedInline: Story = {
parameters: {
// The input keeps focus and arrow keys move through the options, so
// the scrollable list is reachable by keyboard.
a11y: {
// Storybook merges parameters, so `test` must be set here to
// override the warning-only default from `meta`.
test: 'error',
config: {
rules: [
{ id: 'scrollable-region-focusable', enabled: false },
],
},
},
},
Comment thread
ciampo marked this conversation as resolved.
Resolved
args: {
items: ITEMS,
multiple: true,
inline: true,
// `inline` requires `open` so the input references the visible list
// with `aria-controls`.
open: true,
children: [
<Combobox.Input placeholder="Search" key="input" />,
<Combobox.Input
aria-label="Search items"
placeholder="Search items"
key="input"
/>,
<div
style={ {
minHeight: '200px',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const meta: Meta< typeof Select.Root > = {
'Select.Item': Select.Item,
},
parameters: {
// FIXME: Placeholder-like trigger text fails color-contrast (WCAG 1.4.3 applies to placeholder text). The trigger has no visible label and relies on aria-label (button-name).
// FIXME: The trigger has no visible label and relies on aria-label
// (button-name).
// See: https://github.com/WordPress/gutenberg/issues/81596
a11y: { test: 'todo' },
componentStatus: {
Expand Down
33 changes: 0 additions & 33 deletions packages/ui/src/form/select-control/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ const defaultItems = [
];

export const Default: Story = {
parameters: {
// FIXME: Placeholder-like trigger text fails color-contrast (WCAG 1.4.3 applies to placeholder text).
// See: https://github.com/WordPress/gutenberg/issues/81596
a11y: { test: 'todo' },
},
args: {
items: defaultItems,
label: 'Label',
Expand All @@ -53,11 +48,6 @@ export const Default: Story = {
* Prefer a concise label without a trailing ellipsis.
*/
export const WithCustomPlaceholder: Story = {
parameters: {
// FIXME: Placeholder-like trigger text fails color-contrast (WCAG 1.4.3 applies to placeholder text).
// See: https://github.com/WordPress/gutenberg/issues/81596
a11y: { test: 'todo' },
},
args: {
...Default.args,
placeholder: 'Choose an item',
Expand Down Expand Up @@ -88,11 +78,6 @@ const nullValueOptionItems = [
* from the popup.
*/
export const WithNullValueOption: Story = {
parameters: {
// FIXME: Placeholder-like trigger text fails color-contrast (WCAG 1.4.3 applies to placeholder text).
// See: https://github.com/WordPress/gutenberg/issues/81596
a11y: { test: 'todo' },
},
args: {
items: nullValueOptionItems,
label: 'Theme',
Expand All @@ -102,11 +87,6 @@ export const WithNullValueOption: Story = {
};

export const VisuallyHiddenLabel: Story = {
parameters: {
// FIXME: Placeholder-like trigger text fails color-contrast (WCAG 1.4.3 applies to placeholder text).
// See: https://github.com/WordPress/gutenberg/issues/81596
a11y: { test: 'todo' },
},
args: {
...Default.args,
hideLabelFromVision: true,
Expand All @@ -115,9 +95,6 @@ export const VisuallyHiddenLabel: Story = {

export const WithDetails: Story = {
parameters: {
// FIXME: Placeholder-like trigger text fails color-contrast (WCAG 1.4.3 applies to placeholder text).
// See: https://github.com/WordPress/gutenberg/issues/81596
a11y: { test: 'todo' },
docs: { description: { story: WITH_DETAILS_DESCRIPTION } },
},
args: {
Expand Down Expand Up @@ -181,11 +158,6 @@ const groupedItems = [
* resolution, and use `children` to render the grouped popup content.
*/
export const Grouped: Story = {
parameters: {
// FIXME: Placeholder-like trigger text fails color-contrast (WCAG 1.4.3 applies to placeholder text).
// See: https://github.com/WordPress/gutenberg/issues/81596
a11y: { test: 'todo' },
},
args: {
label: 'Fruit',
description: 'Choose a fruit.',
Expand Down Expand Up @@ -288,11 +260,6 @@ export const WithCustomTriggerAndItems: Story = {
* the Item list in the popover will still be rendered based on the `items` array.
*/
export const WithItemsArrayAndPartialCustomization: Story = {
parameters: {
// FIXME: Placeholder-like trigger text fails color-contrast (WCAG 1.4.3 applies to placeholder text).
// See: https://github.com/WordPress/gutenberg/issues/81596
a11y: { test: 'todo' },
},
args: {
...Default.args,
children: [
Expand Down
10 changes: 7 additions & 3 deletions packages/ui/src/utils/css/select-trigger.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,13 @@
text-overflow: ellipsis;
white-space: nowrap;

/* Supports placeholder styling for both Select and Combobox triggers. */
.trigger[data-placeholder] & {
color: var(--wpds-color-foreground-interactive-neutral-disabled);
/*
* An enabled placeholder is live text, so it must meet the text
* contrast minimum that the disabled token falls short of. When
* disabled, the token inherited from `.trigger` applies.
*/
.trigger[data-placeholder]:not([data-disabled]) & {
color: var(--wpds-color-foreground-interactive-neutral-weak);
}
}

Expand Down
Loading