Skip to content

Commit

Permalink
Merge pull request #8295 from stopfstedt/replace_ember_render_modifie…
Browse files Browse the repository at this point in the history
…r-in-global-search-box

replaces ember render modifier based element tracking with DOM tree traversal alternative.
  • Loading branch information
dartajax authored Jan 9, 2025
2 parents 7d60425 + 2a3636a commit 4939361
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion packages/frontend/app/components/global-search-box.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
data-test-input
type="search"
value={{this.computedQuery}}
{{did-insert (set this "searchInputElement")}}
{{on
"input"
(queue
Expand Down
7 changes: 4 additions & 3 deletions packages/frontend/app/components/global-search-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export default class GlobalSearchBox extends Component {
@tracked autocompleteCache = [];
@tracked autocompleteSelectedQuery;
@tracked internalQuery;
@tracked searchInputElement;
@tracked results = null;

get hasResults() {
Expand All @@ -36,8 +35,10 @@ export default class GlobalSearchBox extends Component {
}

@action
focusAndSearch() {
this.searchInputElement.focus();
focusAndSearch(event) {
const searchInputElement =
event.currentTarget.parentElement.getElementsByClassName('global-search-input')[0];
searchInputElement.focus();
this.search();
}

Expand Down

0 comments on commit 4939361

Please sign in to comment.