fix(a11y): remove textbox role from search bar wrapper (#55406)

This commit is contained in:
Huyen Nguyen
2024-07-18 07:48:39 -07:00
committed by GitHub
parent 3fcfe897fb
commit 2c308aed62
5 changed files with 222 additions and 41 deletions
+1 -1
View File
@@ -159,7 +159,7 @@
"@types/react-gtm-module": "2.0.3",
"@types/react-helmet": "6.1.11",
"@types/react-instantsearch-core": "6.26.10",
"@types/react-instantsearch-dom": "6.12.7",
"@types/react-instantsearch-dom": "6.12.8",
"@types/react-redux": "7.1.33",
"@types/react-responsive": "8.0.8",
"@types/react-scrollable-anchor": "0.6.4",
@@ -212,22 +212,21 @@ export class SearchBar extends Component<SearchBarProps, SearchBarState> {
<HotKeys handlers={this.keyHandlers} keyMap={this.keyMap}>
<div className='fcc_search_wrapper'>
<ObserveKeys except={['Space']}>
<div onFocus={this.handleFocus} role='textbox'>
<SearchBox
data-playwright-test-label='header-search'
focusShortcuts={['83', '191']}
onChange={this.handleChange}
onSubmit={e => {
this.handleSearch(e);
}}
showLoadingIndicator={false}
translations={{
submitTitle: t('icons.magnifier'),
resetTitle: t('icons.input-reset'),
placeholder: t('search.placeholder')
}}
/>
</div>
<SearchBox
data-playwright-test-label='header-search'
focusShortcuts={['83', '191']}
onChange={this.handleChange}
onSubmit={e => {
this.handleSearch(e);
}}
showLoadingIndicator={false}
translations={{
submitTitle: t('icons.magnifier'),
resetTitle: t('icons.input-reset'),
placeholder: t('search.placeholder')
}}
onFocus={this.handleFocus}
/>
</ObserveKeys>
{isDropdownEnabled && isSearchFocused && (
<SearchHits