An open source design system that's fully customizable and agent ready
TypeScript
fix(ListInput): remove invalid aria-required from role=group container (#4965)
Ojas Mutreja9c489238b1d7
diff --git a/packages/lab/src/ListInput/ListInput.test.tsx b/packages/lab/src/ListInput/ListInput.test.tsxindex b0f2e0ae2a..bc2f4c5070 100644--- a/packages/lab/src/ListInput/ListInput.test.tsx+++ b/packages/lab/src/ListInput/ListInput.test.tsx@@ -223,6 +223,16 @@ describe('ListInput', () => {);});+ it('never renders aria-required on the group, even when isRequired is set (#4958)', () => {+ // aria-required is not an allowed attribute on role="group" (axe+ // aria-allowed-attr, impact critical). The requirement is already+ // surfaced visibly through Field's Required indicator.+ renderListInput({isRequired: true});++ const group = screen.getByRole('group');+ expect(group).not.toHaveAttribute('aria-required');+ });+it('renders a compact centered EmptyState and keeps Add available', () => {const {container} = renderListInput({value: []});diff --git a/packages/lab/src/ListInput/ListInput.tsx b/packages/lab/src/ListInput/ListInput.tsxindex 2622ba0a21..4b5f277081 100644--- a/packages/lab/src/ListInput/ListInput.tsx+++ b/packages/lab/src/ListInput/ListInput.tsx@@ -1481,7 +1481,6 @@ export function ListInput<T>({aria-labelledby={labelID}aria-describedby={joinIDs(descriptionID, statusID)}aria-disabled={isDisabled || undefined}- aria-required={isRequired || undefined}aria-busy={isLoading || undefined}{...mergeProps(themeProps('list-input', {