Check if activeElement exists before using it
According to MDN, document.activeElement can be null if there is no focused element.
This commit is contained in:
parent
bdc0bbbb4f
commit
4ecb44111d
|
@ -53,7 +53,7 @@ function handleError(event, err) {
|
|||
|
||||
// Remove focus from the currently focused element in order to
|
||||
// prevent keyboard interaction from continuing
|
||||
document.activeElement.blur();
|
||||
if (document.activeElement) { document.activeElement.blur(); }
|
||||
|
||||
// Don't let any element be focusable when showing the error
|
||||
let keyboardFocusable = 'a[href], button, input, textarea, select, details, [tabindex]';
|
||||
|
|
Loading…
Reference in New Issue