Skip to content
Snippets Groups Projects
Commit ea69ab6e authored by jensilo's avatar jensilo
Browse files

fix search input focus for chromium browsers

parent 343df5bd
No related branches found
No related tags found
No related merge requests found
......@@ -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();
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment