« get me outta code hell

client: sidebar-search: tidy sidebar for new queries - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2026-03-31 16:52:55 -0300
committer(quasar) nebula <qznebula@protonmail.com>2026-03-31 16:52:55 -0300
commitb0fb2ddf7e1cfa5f647aa9ca7b9623fe77d121f8 (patch)
tree27f073b1ee0f8abe61be98df23aa54d5932e0806 /src
parentcd8e70bad644479d5bcbdfde4dee6a9dee0a9250 (diff)
client: sidebar-search: tidy sidebar for new queries
Diffstat (limited to 'src')
-rw-r--r--src/static/js/client/sidebar-search.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/static/js/client/sidebar-search.js b/src/static/js/client/sidebar-search.js
index c39c38bc..921b7057 100644
--- a/src/static/js/client/sidebar-search.js
+++ b/src/static/js/client/sidebar-search.js
@@ -106,6 +106,8 @@ export const info = {
     recallingRecentSearch: null,
     recallingRecentSearchFromMouse: null,
 
+    justPerformedActiveQuery: false,
+
     currentValue: null,
 
     workerStatus: null,
@@ -731,6 +733,7 @@ async function activateSidebarSearch(query) {
     return;
   }
 
+  state.justPerformedActiveQuery = true;
   state.searchStage = 'complete';
   updateSidebarSearchStatus();
 
@@ -796,6 +799,7 @@ function clearSidebarSearch() {
   info.searchInput.value = '';
 
   state.searchStage = null;
+  state.justPerformedActiveQuery = false;
 
   clearActiveQuery();
 
@@ -1485,7 +1489,7 @@ function tidySidebarSearchColumn() {
 
   // Don't tidy the sidebar if you've navigated to some other page than
   // what's in the current result list.
-  if (!currentPageIsResult) {
+  if (!state.justPerformedActiveQuery && !currentPageIsResult) {
     return;
   }