Fix activeElement possible null

This commit is contained in:
Pieter Lambrecht 2022-03-18 10:59:18 +01:00
parent 7d7b3b5bcb
commit 8d975d40eb
3 changed files with 1 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View File

@ -38,7 +38,7 @@ function initDocument(): void {
function initWindow(): void {
const contentContainer = document.querySelector<HTMLElement>('.content-container');
if (contentContainer !== null && document.activeElement.tagName.toUpperCase() !== 'INPUT') {
if (contentContainer !== null && document.activeElement !==null && document.activeElement.tagName.toUpperCase() !== 'INPUT') {
// Focus the content container for accessible navigation, unless an input item has focus
contentContainer.focus();
}