Fix :unfocus on nested shadowRoots

This commit is contained in:
Oliver Blanthorn 2020-08-02 12:47:05 +01:00
parent 465913f4be
commit 987133a5f3
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3

View file

@ -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"
}