From 2dc718bdcbf3d147a99c575c8ff4a63fc88bf6bd Mon Sep 17 00:00:00 2001 From: Dan Bradley Date: Sun, 31 Dec 2023 21:45:21 -0600 Subject: [PATCH] Only pay attention to focusout of math-elements in order to allow the 'manual' focusout policy added in issue #1914 to be respected. (#2239) Co-authored-by: Dan Bradley --- src/virtual-keyboard/virtual-keyboard.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/virtual-keyboard/virtual-keyboard.ts b/src/virtual-keyboard/virtual-keyboard.ts index fa987dd21..70ef074ca 100644 --- a/src/virtual-keyboard/virtual-keyboard.ts +++ b/src/virtual-keyboard/virtual-keyboard.ts @@ -302,6 +302,7 @@ export class VirtualKeyboard implements VirtualKeyboardInterface, EventTarget { }); document.addEventListener('focusout', (evt) => { + if ((evt.target as HTMLElement)?.tagName?.toLowerCase() !== 'math-field') return; const target = evt.target as MathfieldElement; if (target.mathVirtualKeyboardPolicy !== 'manual') { // If after a short delay the active element is no longer