diff --git a/src/components/Chip/Chip.tsx b/src/components/Chip/Chip.tsx index 68fb7b70ca..7d2d71c06b 100644 --- a/src/components/Chip/Chip.tsx +++ b/src/components/Chip/Chip.tsx @@ -228,6 +228,8 @@ const Chip = ({ disabled = false, background, 'aria-label': ariaLabel, + 'aria-checked': ariaChecked, + accessibilityState, role = 'button', closeIconAccessibilityLabel = 'Close', closeIconTestID, @@ -378,6 +380,8 @@ const Chip = ({ delayLongPress={delayLongPress} disabled={disabled} aria-label={ariaLabel} + aria-checked={ariaChecked ?? accessibilityState?.checked} + accessibilityState={accessibilityState} role={role} aria-selected={selected} aria-disabled={disabled} diff --git a/src/components/__tests__/Chip.test.tsx b/src/components/__tests__/Chip.test.tsx index 821bb3062f..6f6009d35f 100644 --- a/src/components/__tests__/Chip.test.tsx +++ b/src/components/__tests__/Chip.test.tsx @@ -434,4 +434,30 @@ describe('with reduce motion', () => { expect(elevationTransitionDuration()).toBe(pressed); } ); + + it('forwards aria-checked and accessibilityState to the interactive node', async () => { + await render( + + Checked Chip + + ); + + expect(screen.getByRole('checkbox', { checked: true })).toBeOnTheScreen(); + }); + + it('derives aria-checked from accessibilityState.checked when aria-checked is omitted', async () => { + await render( + + Unchecked Chip + + ); + + expect(screen.getByRole('radio', { checked: false })).toBeOnTheScreen(); + }); });