From 444e05ee21687473c17c19e1d52d7da39694971c Mon Sep 17 00:00:00 2001
From: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 01 Feb 2024 02:35:29 +0000
Subject: [PATCH] chore(deps-dev): bump @types/hast from 3.0.3 to 3.0.4 (#780)
---
quartz/components/scripts/search.inline.ts | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/quartz/components/scripts/search.inline.ts b/quartz/components/scripts/search.inline.ts
index 5f2da36..170a8f0 100644
--- a/quartz/components/scripts/search.inline.ts
+++ b/quartz/components/scripts/search.inline.ts
@@ -281,12 +281,14 @@
})
async function onMouseEnter(ev: MouseEvent) {
- // When search is active, the first element is in focus, so we need to remove focus if given target is not the first element
- const firstEl = document.getElementsByClassName("result-card")[0] as HTMLAnchorElement | null
- const target = ev.target as HTMLAnchorElement
- if (firstEl !== target) {
- firstEl?.classList.remove("focus")
+ // Actually when we hover, we need to clean all highlights within the result childs
+ for (const el of document.getElementsByClassName(
+ "result-card",
+ ) as HTMLCollectionOf<HTMLElement>) {
+ el.classList.remove("focus")
+ el.blur()
}
+ const target = ev.target as HTMLAnchorElement
target.classList.add("focus")
await displayPreview(target)
}
--
Gitblit v1.10.0