diff --git a/src/ui/components/search/autocompletecomponent.js b/src/ui/components/search/autocompletecomponent.js index d177a8ef7..c01ededfc 100644 --- a/src/ui/components/search/autocompletecomponent.js +++ b/src/ui/components/search/autocompletecomponent.js @@ -214,6 +214,7 @@ export default class AutoCompleteComponent extends Component { resultIndex: this._resultIndex, promptHeader: this._originalQuery.length === 0 ? this.promptHeader : null, listLabelIdName: this.listLabelIdName, + autocompleteContainerIdName: `yxt-AutoComplete-container-${this._config.name.replaceAll('.', '-')}`, eventOptions: this.eventOptions(data) })); } diff --git a/src/ui/components/search/searchcomponent.js b/src/ui/components/search/searchcomponent.js index ceeb4d157..57ee75b52 100644 --- a/src/ui/components/search/searchcomponent.js +++ b/src/ui/components/search/searchcomponent.js @@ -678,6 +678,7 @@ export default class SearchComponent extends Component { labelText: this.labelText, inputLabelIdName: this.inputLabelIdName, submitIcon: this.submitIcon, + searchBarContainerId: this._container.id, submitText: this.submitText, clearText: this.clearText, showClearButton: this._showClearButton, diff --git a/src/ui/templates/search/search.hbs b/src/ui/templates/search/search.hbs index 801f696bc..d11f09e56 100644 --- a/src/ui/templates/search/search.hbs +++ b/src/ui/templates/search/search.hbs @@ -23,10 +23,10 @@ aria-label="{{labelText}}" aria-autocomplete="list" aria-controls="{{autocompleteContainerIdName}}" - aria-describedby="instructions" + aria-describedby="{{searchBarContainerId}}-instructions" aria-haspopup="listbox" > -