diff options
Diffstat (limited to 'src/static/js/client/sidebar-search.js')
-rw-r--r-- | src/static/js/client/sidebar-search.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/static/js/client/sidebar-search.js b/src/static/js/client/sidebar-search.js index 34d2161f..ae18c930 100644 --- a/src/static/js/client/sidebar-search.js +++ b/src/static/js/client/sidebar-search.js @@ -303,15 +303,20 @@ export function mutatePageContent() { export function addPageListeners() { if (!info.searchInput) return; + let prevValue = null; info.searchInput.addEventListener('change', _domEvent => { - if (info.searchInput.value) { + if (info.searchInput.value && info.searchInput.value !== prevValue) { activateSidebarSearch(info.searchInput.value); } + prevValue = info.searchInput.value; }); info.searchInput.addEventListener('input', _domEvent => { const {settings, state} = info; + if (prevValue === info.searchInput.value) return; + prevValue = info.searchInput.value; + if (!info.searchInput.value) { clearSidebarSearch(); return; |