mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 11:36:36 +00:00
fix(composed-modal): replace onDestroy with onMount for SSR support
Fixes #200 for ComposedModal, same as #207
This commit is contained in:
parent
720ef778f2
commit
44b02c19d0
1 changed files with 3 additions and 5 deletions
|
@ -36,7 +36,6 @@
|
||||||
setContext,
|
setContext,
|
||||||
onMount,
|
onMount,
|
||||||
afterUpdate,
|
afterUpdate,
|
||||||
onDestroy,
|
|
||||||
} from "svelte";
|
} from "svelte";
|
||||||
import { writable } from "svelte/store";
|
import { writable } from "svelte/store";
|
||||||
|
|
||||||
|
@ -75,10 +74,9 @@
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
await tick();
|
await tick();
|
||||||
focus();
|
focus();
|
||||||
});
|
return () => {
|
||||||
|
document.body.classList.remove("bx--body--with-modal-open");
|
||||||
onDestroy(() => {
|
};
|
||||||
document.body.classList.remove("bx--body--with-modal-open");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
afterUpdate(() => {
|
afterUpdate(() => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue