mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
fix(composed-modal): perform null check before focusing element
Fixes error in Sapper
This commit is contained in:
parent
add8c1c75a
commit
05932065dc
1 changed files with 2 additions and 2 deletions
|
@ -71,7 +71,7 @@
|
|||
function focus(element) {
|
||||
const node =
|
||||
(element || innerModal).querySelector(selectorPrimaryFocus) || buttonRef;
|
||||
node.focus();
|
||||
if (node != null) node.focus();
|
||||
}
|
||||
|
||||
$: opened = false;
|
||||
|
@ -84,7 +84,7 @@
|
|||
|
||||
onDestroy(() => {
|
||||
document.body.classList.remove("bx--body--with-modal-open");
|
||||
})
|
||||
});
|
||||
|
||||
afterUpdate(() => {
|
||||
if (opened) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue