mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 03:26: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,
|
||||
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(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue