diff --git a/changelog.md b/changelog.md index 37e228d229..1be1381cd5 100644 --- a/changelog.md +++ b/changelog.md @@ -9,6 +9,7 @@ [PickerInput]: set `overflow: hidden;` on open for mobile [TextArea and TextInput]: fix maxLength for Android [PickerInput]: Disable select all button if options are empty and it has no selection +[DataTable]: fixed missing `role=table` # 5.2.0 - 16.10.2023 diff --git a/uui/components/layout/VirtualList.tsx b/uui/components/layout/VirtualList.tsx index 4a292f5d49..73749a2445 100644 --- a/uui/components/layout/VirtualList.tsx +++ b/uui/components/layout/VirtualList.tsx @@ -66,6 +66,14 @@ export const VirtualList = React.forwardRef((pr ); + const renderView = ({ style }: any) => ( + + ); + const scrollBarsRef = React.useCallback((scrollbars: ScrollbarsApi) => { if (!scrollbars?.container?.firstChild) return; scrollContainerRef.current = scrollbars.container.firstChild as HTMLDivElement; @@ -79,7 +87,7 @@ export const VirtualList = React.forwardRef((pr [uuiMarkers.scrolledBottom]: scrollShadows.verticalBottom, }) } onScroll={ handleScroll } - renderView={ ({ style }: any) => } + renderView={ renderView } ref={ scrollBarsRef } > {renderRows()} diff --git a/uui/components/pickers/__tests__/__snapshots__/PickerInput.test.tsx.snap b/uui/components/pickers/__tests__/__snapshots__/PickerInput.test.tsx.snap index 7fbb52db73..cfe01ee66b 100644 --- a/uui/components/pickers/__tests__/__snapshots__/PickerInput.test.tsx.snap +++ b/uui/components/pickers/__tests__/__snapshots__/PickerInput.test.tsx.snap @@ -57,6 +57,7 @@ exports[`PickerInput should open body 1`] = ` style="position: relative; overflow: hidden; width: 100%; height: 100%; display: flex;" >
{ const tree = await renderSnapshotWithContextAsync( [] } value={ {} } onValueChange={ jest.fn } />); expect(tree).toMatchSnapshot(); }); + + it('should have role=table', async () => { + await renderWithContextAsync( [] } value={ {} } onValueChange={ jest.fn } />); + expect(screen.getByRole('table')).toBeInTheDocument(); + }); }); diff --git a/uui/components/tables/__tests__/__snapshots__/DataTable.test.tsx.snap b/uui/components/tables/__tests__/__snapshots__/DataTable.test.tsx.snap index 52cfbe33e2..bf49ff0e42 100644 --- a/uui/components/tables/__tests__/__snapshots__/DataTable.test.tsx.snap +++ b/uui/components/tables/__tests__/__snapshots__/DataTable.test.tsx.snap @@ -14,6 +14,8 @@ exports[`DataTable should be rendered correctly 1`] = ` } >