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 changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 9 additions & 1 deletion uui/components/layout/VirtualList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ export const VirtualList = React.forwardRef<ScrollbarsApi, VirtualListProps>((pr
</div>
);

const renderView = ({ style }: any) => (
<VirtualListView
isLoading={ props.isLoading }
style={ style }
rawProps={ props.rawProps }
/>
);

const scrollBarsRef = React.useCallback((scrollbars: ScrollbarsApi) => {
if (!scrollbars?.container?.firstChild) return;
scrollContainerRef.current = scrollbars.container.firstChild as HTMLDivElement;
Expand All @@ -79,7 +87,7 @@ export const VirtualList = React.forwardRef<ScrollbarsApi, VirtualListProps>((pr
[uuiMarkers.scrolledBottom]: scrollShadows.verticalBottom,
}) }
onScroll={ handleScroll }
renderView={ ({ style }: any) => <VirtualListView isLoading={ props.isLoading } style={ style } /> }
renderView={ renderView }
ref={ scrollBarsRef }
>
{renderRows()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ exports[`PickerInput should open body 1`] = `
style="position: relative; overflow: hidden; width: 100%; height: 100%; display: flex;"
>
<div
aria-orientation="vertical"
style="position: relative; top: 0px; left: 0px; right: 0px; bottom: 0px; overflow: scroll; margin-right: 0px; margin-bottom: 0px; flex: 1 1 auto; display: flex; flex-direction: column;"
>
<div
Expand Down
7 changes: 6 additions & 1 deletion uui/components/tables/__tests__/DataTable.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { renderSnapshotWithContextAsync } from '@epam/uui-test-utils';
import { renderSnapshotWithContextAsync, renderWithContextAsync, screen } from '@epam/uui-test-utils';
import { DataTable } from '../DataTable';

class ResizeObserverMock {
Expand All @@ -15,4 +15,9 @@ describe('DataTable', () => {
const tree = await renderSnapshotWithContextAsync(<DataTable columns={ [] } getRows={ () => [] } value={ {} } onValueChange={ jest.fn } />);
expect(tree).toMatchSnapshot();
});

it('should have role=table', async () => {
await renderWithContextAsync(<DataTable columns={ [] } getRows={ () => [] } value={ {} } onValueChange={ jest.fn } />);
expect(screen.getByRole('table')).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ exports[`DataTable should be rendered correctly 1`] = `
}
>
<div
aria-colcount={0}
role="table"
style={
Object {
"WebkitOverflowScrolling": "touch",
Expand Down