From c7fc949508c7ee58ef658046e38732a7d5407634 Mon Sep 17 00:00:00 2001 From: Damien Vitrac Date: Fri, 26 Jan 2024 14:35:34 +0100 Subject: [PATCH] feat: Init search on first render popup --- src/js/vendor/search.bundle.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/js/vendor/search.bundle.js b/src/js/vendor/search.bundle.js index 1937ec7..1d0765d 100644 --- a/src/js/vendor/search.bundle.js +++ b/src/js/vendor/search.bundle.js @@ -2,7 +2,7 @@ ;(function () { const isMac = () => navigator.platform.indexOf('Mac') > -1 - + let loaded = false const config = document.getElementById('search-script').dataset const client = algoliasearch(config.appId, config.apiKey) let selected = null @@ -222,9 +222,11 @@ }), ]) - search.start() - const open = () => { + if (!loaded) { + search.start() + loaded = true + } selectHit(null) MicroModal.show('modal-1', { disableScroll: true,