fix(composed-modal): node to focus is possibly null (#1364)

Fixes #1360
This commit is contained in:
metonym 2022-06-22 06:24:02 -07:00 committed by GitHub
commit 9fcf9855e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -66,7 +66,7 @@
function focus(element) {
if (selectorPrimaryFocus == null) return;
const node =
(element || innerModal).querySelector(selectorPrimaryFocus) || buttonRef;
(element || innerModal)?.querySelector(selectorPrimaryFocus) || buttonRef;
if (node != null) node.focus();
}