Commit a24cb95f authored by Lukas Eipert's avatar Lukas Eipert

Safe guard search initialization

The search initialization errors on pages that don't have a search (e.g.
login, terms agreement page)
parent f628bfb9
......@@ -111,7 +111,9 @@ function deferredInitialisation() {
initPersistentUserCallouts();
initDefaultTrackers();
document.querySelector('#search').addEventListener(
const search = document.querySelector('#search');
if (search) {
search.addEventListener(
'focus',
() => {
import(/* webpackChunkName: 'globalSearch' */ './search_autocomplete')
......@@ -123,6 +125,7 @@ function deferredInitialisation() {
},
{ once: true },
);
}
addSelectOnFocusBehaviour('.js-select-on-focus');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment