('focusout', (ev) => {
        const kbdPanel = document.getElementById('keyboard-container');
        if (ev.target.tagName === 'MATH-FIELD') {
          const kbdPanel = document.getElementById('keyboard-container');
          kbdPanel.style.display = 'none';
          mathVirtualKeyboard.visible = false;
        }
      });

      document.addEventListener('focusin', (ev) => {
        if (ev.target.tagName === 'MATH-FIELD') {
          positionPopupKeyboard(ev.target);
        } else {
          const kb