Skip to content

Commit

Permalink
search label for attribute doesn't match id of input (fixes storybook…
Browse files Browse the repository at this point in the history
…js#23463)

The for attribute value was not set to match the hardcoded value
used for the search input id.
  • Loading branch information
Gavin King committed Jul 15, 2023
1 parent 3531eb3 commit 16d0156
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion code/ui/manager/src/components/sidebar/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,13 @@ export const Search = React.memo<{
onBlur: () => setPlaceholder('Find components'),
});

const labelProps = getLabelProps({
htmlFor: 'storybook-explorer-searchfield',
});

return (
<>
<ScreenReaderLabel {...getLabelProps()}>Search for components</ScreenReaderLabel>
<ScreenReaderLabel {...labelProps}>Search for components</ScreenReaderLabel>
<SearchField
{...getRootProps({ refKey: '' }, { suppressRefError: true })}
className="search-field"
Expand Down

0 comments on commit 16d0156

Please sign in to comment.