fix(ui): add missing aria-label to SearchField components
Add aria-label attributes to SearchField components to fix accessibility warnings from React Aria. - Select: add aria-label to SearchField using searchPlaceholder - MenuAutocomplete: add aria-label to RASearchField, remove redundant aria-label from RAInput - MenuAutocompleteListbox: same as MenuAutocomplete Per React Aria docs, aria-label should be on SearchField, not the child Input. Signed-off-by: Johan Persson <johanopersson@gmail.com>
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'@backstage/ui': patch
|
||||
---
|
||||
|
||||
Added missing `aria-label` attributes to `SearchField` components in `Select`, `MenuAutocomplete`, and `MenuAutocompleteListbox` to fix accessibility warnings.
|
||||
|
||||
Affected components: Select, MenuAutocomplete, MenuAutocompleteListbox
|
||||
@@ -255,13 +255,13 @@ export const MenuAutocomplete = (props: MenuAutocompleteProps<object>) => {
|
||||
classNames.searchField,
|
||||
styles[classNames.searchField],
|
||||
)}
|
||||
aria-label={props.placeholder || 'Search'}
|
||||
>
|
||||
<RAInput
|
||||
className={clsx(
|
||||
classNames.searchFieldInput,
|
||||
styles[classNames.searchFieldInput],
|
||||
)}
|
||||
aria-label="Search"
|
||||
placeholder={props.placeholder || 'Search...'}
|
||||
/>
|
||||
<RAButton
|
||||
@@ -334,13 +334,13 @@ export const MenuAutocompleteListbox = (
|
||||
classNames.searchField,
|
||||
styles[classNames.searchField],
|
||||
)}
|
||||
aria-label={props.placeholder || 'Search'}
|
||||
>
|
||||
<RAInput
|
||||
className={clsx(
|
||||
classNames.searchFieldInput,
|
||||
styles[classNames.searchFieldInput],
|
||||
)}
|
||||
aria-label="Search"
|
||||
placeholder={props.placeholder || 'Search...'}
|
||||
/>
|
||||
<RAButton
|
||||
|
||||
@@ -55,6 +55,7 @@ export function SelectContent({
|
||||
classNames.searchWrapper,
|
||||
styles[classNames.searchWrapper],
|
||||
)}
|
||||
aria-label={searchPlaceholder}
|
||||
>
|
||||
<Input
|
||||
placeholder={searchPlaceholder}
|
||||
|
||||
Reference in New Issue
Block a user