Skip to content

Commit

Permalink
chore(Table): Add aria-label to Table page size selector (#29391)
Browse files Browse the repository at this point in the history
  • Loading branch information
geido committed Jun 28, 2024
1 parent 2a587a7 commit 66bc8ce
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,13 @@ function DefaultSelectRenderer({
const [size, text] = Array.isArray(option)
? option
: [option, option];
const sizeLabel = size === 0 ? t('all') : size;
return (
<option key={size} value={size}>
<option
aria-label={t('Show %s entries', sizeLabel)}
key={size}
value={size}
>
{text}
</option>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ function SearchInput({ count, value, onChange }: SearchInputProps) {
<span className="dt-global-filter">
{t('Search')}{' '}
<input
aria-label={t('Search %s records', count)}
className="form-control input-sm"
placeholder={tn('search.num_records', count)}
value={value}
aria-label={t('Search %s records', count)}
onChange={onChange}
/>
</span>
Expand All @@ -211,8 +211,13 @@ function SelectPageSize({
const [size, text] = Array.isArray(option)
? option
: [option, option];
const sizeLabel = size === 0 ? t('all') : size;
return (
<option key={size} value={size}>
<option
aria-label={t('Show %s entries', sizeLabel)}
key={size}
value={size}
>
{text}
</option>
);
Expand Down

0 comments on commit 66bc8ce

Please sign in to comment.