Skip to content

Commit

Permalink
fix pagination a11y errors and remaining PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jenny-s51 committed Mar 9, 2023
1 parent 3790cbb commit 23f6950
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions frontend/src/components/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ const Table = <T,>({
const sort = useTableColumnSort<T>(columns, 0);

const showPagination = enablePagination && allData.length > minPageSize;
const pagination = (pageDirection: 'up' | 'down') => (
const pagination = (variant: 'top' | 'bottom') => (
<Pagination
dropDirection={pageDirection}
perPageComponent="button"
itemCount={allData.length}
perPage={pageSize}
Expand All @@ -62,6 +61,7 @@ const Table = <T,>({
setPageSize(newSize);
setPage(newPage);
}}
variant={variant}
widgetId="table-pagination"
/>
);
Expand All @@ -74,7 +74,7 @@ const Table = <T,>({
{toolbarContent}
{showPagination && (
<ToolbarItem variant="pagination" alignment={{ default: 'alignRight' }}>
{pagination('down')}
{pagination('top')}
</ToolbarItem>
)}
</ToolbarContent>
Expand Down Expand Up @@ -112,7 +112,7 @@ const Table = <T,>({
<Toolbar>
<ToolbarContent>
<ToolbarItem variant="pagination" alignment={{ default: 'alignRight' }}>
{pagination('up')}
{pagination('bottom')}
</ToolbarItem>
</ToolbarContent>
</Toolbar>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/projects/components/PasswordInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const PasswordInput: React.FC<React.ComponentProps<typeof TextInput>> = (props)
<InputGroup>
<TextInput {...props} type={isPassword ? 'password' : 'text'} />
<Button
aria-label={isPassword ? 'Show key' : 'Hide key'}
aria-label={isPassword ? 'Show password' : 'Hide password'}
variant="control"
onClick={() => setPassword(!isPassword)}
>
Expand Down

0 comments on commit 23f6950

Please sign in to comment.