Skip to content

Commit

Permalink
feat(apps/web): Add aria labels.
Browse files Browse the repository at this point in the history
  • Loading branch information
nevendyulgerov committed Jan 30, 2025
1 parent 7b665dc commit 88c386b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion apps/web/src/components/paginated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
Stack,
StackProps,
Text,
VisuallyHidden,
} from "@mantine/core";
import { useScrollIntoView } from "@mantine/hooks";
import { pathOr } from "ramda";
Expand Down Expand Up @@ -88,6 +89,9 @@ const Paginated: FC<PaginatedProps> = (props) => {
value={activePage}
total={totalPages}
onChange={onChangeTopPagination}
getControlProps={(control) => ({
"aria-label": control,
})}
/>

{children}
Expand All @@ -96,7 +100,12 @@ const Paginated: FC<PaginatedProps> = (props) => {
<Group>
<Text>Show:</Text>
<Select
style={{ width: "5rem" }}
label={
<VisuallyHidden>
Change number of items per page
</VisuallyHidden>
}
style={{ width: "5rem", display: "flex" }}
value={limit.toString()}
onChange={onChangeLimit}
data={perPageList}
Expand All @@ -108,6 +117,9 @@ const Paginated: FC<PaginatedProps> = (props) => {
value={activePage}
total={totalPages}
onChange={onChangeBottomPagination}
getControlProps={(control) => ({
"aria-label": control,
})}
/>
</Group>
</Stack>
Expand Down

0 comments on commit 88c386b

Please sign in to comment.