mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
fix(composed-modal): node to focus is possibly null
(#1364)
Fixes #1360
This commit is contained in:
parent
c7be47cefb
commit
9fcf9855e6
1 changed files with 1 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue