diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-05-05 12:38:15 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-05-31 12:11:49 -0300 |
commit | e149147ff846a91c810cf14451d711d211044a7d (patch) | |
tree | d3704246ccb70f5ffed4f3aac33a8702eae03a8a | |
parent | 5fbff602f593260b7cb0174544cd12713795de69 (diff) |
client: cancel delay-search when input is cleared
-rw-r--r-- | src/static/js/client.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/static/js/client.js b/src/static/js/client.js index 0d6cc4e1..d3c7f36a 100644 --- a/src/static/js/client.js +++ b/src/static/js/client.js @@ -3676,7 +3676,12 @@ async function activateSidebarSearch(query) { function clearSidebarSearch() { const info = sidebarSearchInfo; - const {session} = info; + const {session, state} = info; + + if (state.stoppedTypingTimeout) { + clearTimeout(state.stoppedTypingTimeout); + state.stoppedTypingTimeout = null; + } info.searchInput.value = ''; session.activeQuery = ''; |