diff --git a/src/DataGrid.tsx b/src/DataGrid.tsx index 9732d4bd63..16211234e9 100644 --- a/src/DataGrid.tsx +++ b/src/DataGrid.tsx @@ -101,6 +101,7 @@ type SharedDivProps = Pick< | 'role' | 'aria-label' | 'aria-labelledby' + | 'aria-description' | 'aria-describedby' | 'aria-rowcount' | 'className' @@ -260,6 +261,7 @@ function DataGrid( role: rawRole, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, + 'aria-description': ariaDescription, 'aria-describedby': ariaDescribedBy, 'aria-rowcount': rawAriaRowCount, 'data-testid': testId @@ -1076,10 +1078,12 @@ function DataGrid( selectedPosition.idx === -1 && selectedPosition.rowIdx !== minRowIdx - 1; return ( + // biome-ignore lint/a11y/useValidAriaProps: aria-description is a valid prop
{ + setup({ + rows: [], + columns: [], + 'aria-label': 'label', + 'aria-labelledby': 'labelledby', + 'aria-description': 'description', + 'aria-describedby': 'describedby' + }); + + const grid = getGrid().element(); + expect(grid).toHaveAttribute('aria-label', 'label'); + expect(grid).toHaveAttribute('aria-labelledby', 'labelledby'); + expect(grid).toHaveAttribute('aria-description', 'description'); + expect(grid).toHaveAttribute('aria-describedby', 'describedby'); +});