From 16bb1f989ab6b3cf2a05a20fefd8c9c1b4e43db3 Mon Sep 17 00:00:00 2001 From: HighImKevin Date: Wed, 7 Jan 2026 15:04:30 -0500 Subject: [PATCH] Fix issue when closing context menus or modals on the search page causing the search page to break (closes #73) --- scripts/search.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/search.js b/scripts/search.js index f4b354d..f32785d 100644 --- a/scripts/search.js +++ b/scripts/search.js @@ -201,7 +201,7 @@ // Hide search suggestions const searchSuggestions = searchPage.querySelector('.searchSuggestions'); if (searchSuggestions) { - searchSuggestions.remove(); + searchSuggestions.style.display = 'none'; } const noItemsMessage = searchPage.querySelector('.noItemsMessage.dummy-section'); @@ -491,9 +491,10 @@ wrapper.appendChild(btnRow); wrapper.appendChild(stats); - // Replace the original input with our wrapper + // Insert the wrapper before the original input originalInput.parentElement.insertBefore(wrapper, originalInput); - originalInput.remove(); // Remove the original input + // Hide the original input + originalInput.style.display = 'none'; input.focus(); }