diff --git a/resources/report/html/loot-search.html b/resources/report/html/loot-search.html index c8b2ca07..5420bf56 100644 --- a/resources/report/html/loot-search.html +++ b/resources/report/html/loot-search.html @@ -109,6 +109,10 @@ searchTarget is the ID of the core-list element to search the elements of. document.getElementById(host.searchTarget).scrollToItem(host.results[host.currentResult]); }, + focusInput: function() { + this.shadowRoot.getElementById('search').focus(); + }, + search: function() { this.shadowRoot.getElementById('search').dispatchEvent(new Event('input')); }, diff --git a/resources/report/js/events.js b/resources/report/js/events.js index f42719d7..6b2d41d2 100644 --- a/resources/report/js/events.js +++ b/resources/report/js/events.js @@ -648,6 +648,7 @@ function onContentRefresh(evt) { } function onSearchOpen(evt) { document.getElementById('mainToolbar').classList.add('search'); + document.getElementById('searchBar').focusInput(); } function onSearchClose(evt) { document.getElementById('mainToolbar').classList.remove('search');