From bb24cd13c7fafbd42d3980c45351a58a76dabb18 Mon Sep 17 00:00:00 2001
From: 1 gal Rosemary <cerasusyedoensis@proton.me>
Date: Sat, 05 Apr 2025 17:39:28 +0000
Subject: [PATCH] fix(css): styles issues with popover, overflow, and scroll overflow (#1907)

---
 quartz/components/scripts/search.inline.ts |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/quartz/components/scripts/search.inline.ts b/quartz/components/scripts/search.inline.ts
index 1f4c009..d95f468 100644
--- a/quartz/components/scripts/search.inline.ts
+++ b/quartz/components/scripts/search.inline.ts
@@ -147,8 +147,7 @@
   const container = searchElement.querySelector(".search-container") as HTMLElement
   if (!container) return
 
-  const sidebar = container.closest(".sidebar") as HTMLElement
-  if (!sidebar) return
+  const sidebar = container.closest(".sidebar") as HTMLElement | null
 
   const searchButton = searchElement.querySelector(".search-button") as HTMLButtonElement
   if (!searchButton) return
@@ -180,7 +179,7 @@
   function hideSearch() {
     container.classList.remove("active")
     searchBar.value = "" // clear the input when we dismiss the search
-    sidebar.style.zIndex = ""
+    if (sidebar) sidebar.style.zIndex = ""
     removeAllChildren(results)
     if (preview) {
       removeAllChildren(preview)
@@ -192,7 +191,7 @@
 
   function showSearch(searchTypeNew: SearchType) {
     searchType = searchTypeNew
-    sidebar.style.zIndex = "1"
+    if (sidebar) sidebar.style.zIndex = "1"
     container.classList.add("active")
     searchBar.focus()
   }

--
Gitblit v1.10.0