Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Aria labels to hitsPerPage #6473

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const renderer =
<div className={cssClasses.root}>
<Selector
cssClasses={cssClasses}
ariaLabel='Items per page'
currentValue={currentValue}
options={items}
// @ts-expect-error: the refine function expects a number, but setValue will call it with a string. We don't want to change the type of the refine function because it's part of the connector API.
Expand Down
1 change: 1 addition & 0 deletions packages/react-instantsearch/src/ui/HitsPerPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export function HitsPerPage({
>
<select
className={cx('ais-HitsPerPage-select', classNames.select)}
aria-label="Items per page"
onChange={(event) => {
onChange(Number(event.target.value));
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ describe('HitsPerPage', () => {
class="ais-HitsPerPage"
>
<select
aria-label="Items per page"
class="ais-HitsPerPage-select"
>
<option
Expand Down Expand Up @@ -112,6 +113,7 @@ describe('HitsPerPage', () => {
class="ais-HitsPerPage ROOT MyCustomHitsPerPage"
>
<select
aria-label="Items per page"
class="ais-HitsPerPage-select SELECT"
>
<option
Expand Down
1 change: 1 addition & 0 deletions packages/vue-instantsearch/src/components/HitsPerPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
>
<select
:class="suit('select')"
aria-label="Items per page"
@change="state.refine(Number($event.currentTarget.value))"
>
<option
Expand Down
2 changes: 2 additions & 0 deletions tests/common/widgets/hits-per-page/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export function createOptionsTests(
class="ais-HitsPerPage"
>
<select
aria-label="Items per page"
class="ais-HitsPerPage-select"
>
<option
Expand Down Expand Up @@ -94,6 +95,7 @@ export function createOptionsTests(
class="ais-HitsPerPage"
>
<select
aria-label="Items per page"
class="ais-HitsPerPage-select"
>
<option
Expand Down