mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 13:24:05 -06:00
fix for issue "Search Component Doesn't work if in beforeBody section #1905"
This commit is contained in:
parent
f334e78ed6
commit
223884423b
@ -147,7 +147,7 @@ async function setupSearch(searchElement: Element, currentSlug: FullSlug, data:
|
|||||||
const container = searchElement.querySelector(".search-container") as HTMLElement
|
const container = searchElement.querySelector(".search-container") as HTMLElement
|
||||||
if (!container) return
|
if (!container) return
|
||||||
|
|
||||||
const sidebar = container.closest(".sidebar") as HTMLElement
|
const sidebar = container.closest(".sidebar") || document.body
|
||||||
if (!sidebar) return
|
if (!sidebar) return
|
||||||
|
|
||||||
const searchButton = searchElement.querySelector(".search-button") as HTMLButtonElement
|
const searchButton = searchElement.querySelector(".search-button") as HTMLButtonElement
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user