refactor(composed-modal): replace onDestroy with onMount return function

This commit is contained in:
metonym 2021-11-17 13:16:02 -08:00
commit 286f55fc01

View file

@ -36,7 +36,6 @@
setContext,
onMount,
afterUpdate,
onDestroy,
} from "svelte";
import { writable } from "svelte/store";
@ -73,13 +72,14 @@
let opened = false;
$: didOpen = open;
onMount(async () => {
await tick();
onMount(() => {
tick().then(() => {
focus();
});
onDestroy(() => {
return () => {
document.body.classList.remove("bx--body--with-modal-open");
};
});
afterUpdate(() => {