From 987133a5f39378b4a82a15beabb03b3fbaec5fb4 Mon Sep 17 00:00:00 2001 From: Oliver Blanthorn Date: Sun, 2 Aug 2020 12:47:05 +0100 Subject: [PATCH] Fix `:unfocus` on nested shadowRoots --- src/excmds.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/excmds.ts b/src/excmds.ts index 6dd743c4..27570a3a 100644 --- a/src/excmds.ts +++ b/src/excmds.ts @@ -997,7 +997,7 @@ document.addEventListener("load", () => curJumps().then(() => jumpprev(0))) /** Blur (unfocus) the active element */ //#content export function unfocus() { - document.activeElement.shadowRoot ? (document.activeElement.shadowRoot.activeElement as HTMLInputElement).blur() : (document.activeElement as HTMLInputElement).blur() + ;((document.activeElement.shadowRoot ? DOM.deepestShadowRoot(document.activeElement.shadowRoot) : document).activeElement as HTMLInputElement).blur() contentState.mode = "normal" }