fix(composed-modal): replace onDestroy with onMount for SSR support

Fixes #200 for ComposedModal, same as #207
This commit is contained in:
Adam Ashton 2021-02-28 19:52:46 +00:00
commit 44b02c19d0

View file

@ -36,7 +36,6 @@
setContext,
onMount,
afterUpdate,
onDestroy,
} from "svelte";
import { writable } from "svelte/store";
@ -75,10 +74,9 @@
onMount(async () => {
await tick();
focus();
});
onDestroy(() => {
document.body.classList.remove("bx--body--with-modal-open");
return () => {
document.body.classList.remove("bx--body--with-modal-open");
};
});
afterUpdate(() => {