From 75e78591461713111c2abed604c4ef24afa6353f Mon Sep 17 00:00:00 2001 From: Josh Bairstow Date: Tue, 2 Jun 2026 01:35:53 +1000 Subject: [PATCH] chore(blog): guard keydown for IME composition and as editable so / doesn't steal focus while a dropdown is open and the user is typing to seek. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/components/molecules/BlogSearch.astro | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/molecules/BlogSearch.astro b/src/components/molecules/BlogSearch.astro index c7b461e..d38b1e5 100644 --- a/src/components/molecules/BlogSearch.astro +++ b/src/components/molecules/BlogSearch.astro @@ -146,12 +146,14 @@ // contenteditable element). `Esc` while the input is focused clears the // query, blurs, and restores the full archive. document.addEventListener("keydown", (event) => { + if (event.isComposing) return; if (event.key === "/" && !event.metaKey && !event.ctrlKey && !event.altKey) { const target = event.target as HTMLElement | null; const tag = target?.tagName; const editable = tag === "INPUT" || tag === "TEXTAREA" || + tag === "SELECT" || target?.isContentEditable === true; if (!editable) { event.preventDefault();