Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Bug Fixes

- `RadioControl`: Add `role="radiogroup"` to the wrapping `fieldset` element ([#76745](https://github.com/WordPress/gutenberg/pull/76745)).
- `CustomGradientPicker`: Add state persistence when switching between Linear and Radial Gradient ([#76595](https://github.com/WordPress/gutenberg/pull/76595)).

## 32.4.0 (2026-03-18)
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/radio-control/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export function RadioControl(
return (
<fieldset
id={ id }
role="radiogroup"
className={ clsx( className, 'components-radio-control' ) }
aria-describedby={ !! help ? generateHelpId( id ) : undefined }
>
Expand Down
10 changes: 5 additions & 5 deletions packages/components/src/radio-control/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,18 @@ describe.each( [
const [ , Component ] = modeAndComponent;

describe( 'semantics and labelling', () => {
it( 'should group all radios under a fieldset with an accessible label (legend)', () => {
it( 'should render a radiogroup with an accessible label (legend)', () => {
const onChangeSpy = jest.fn();
render(
<Component { ...defaultProps } onChange={ onChangeSpy } />
);

expect(
screen.getByRole( 'group', { name: defaultProps.label } )
screen.getByRole( 'radiogroup', { name: defaultProps.label } )
).toBeVisible();
} );

it( 'should group all radios under a fieldset with an accessible label even when the label is visually hidden', () => {
it( 'should render a radiogroup with an accessible label even when the label is visually hidden', () => {
const onChangeSpy = jest.fn();
render(
<Component
Expand All @@ -78,7 +78,7 @@ describe.each( [
);

expect(
screen.getByRole( 'group', { name: defaultProps.label } )
screen.getByRole( 'radiogroup', { name: defaultProps.label } )
).toBeVisible();
} );

Expand All @@ -93,7 +93,7 @@ describe.each( [
);

expect(
screen.getByRole( 'group', { name: defaultProps.label } )
screen.getByRole( 'radiogroup', { name: defaultProps.label } )
).toHaveAccessibleDescription( 'Test help text' );
} );

Expand Down
Loading