diff --git a/public/assets/js/eiffel.js b/public/assets/js/eiffel.js index 318d2ff48eed0cc65199d94fecb2830c9e243970..a84c4967ca277dcd1a12d943596e22fb6740ef1a 100644 --- a/public/assets/js/eiffel.js +++ b/public/assets/js/eiffel.js @@ -29,7 +29,9 @@ registerCopyToClipboard(); function registerFocuses() { // focus search input when search form is loaded (in the case bootstrap finishes showing the modal before the form is loaded) document.addEventListener('htmx:afterSettle', function(event) { - if (event.detail.elt.id !== 'eiffelTemplateSearch') return; + // focus search input if the search modal was loaded or the search results were loaded + // unfortunately, chromium takes the focus from the input when the results are loaded, so we need to refocus + if (event.detail.elt.id !== 'eiffelTemplateSearch' && event.detail.elt.id !== 'eiffelTemplateSearchResults') return; focusSearchInput(); })