mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
Merge pull request #348 from weaseldotro/patch-1
fix(ComposedModal): remove bx--body--with-modal-open from body classes after destroy
This commit is contained in:
commit
350aad83e0
1 changed files with 5 additions and 4 deletions
|
@ -47,6 +47,7 @@
|
||||||
setContext,
|
setContext,
|
||||||
onMount,
|
onMount,
|
||||||
afterUpdate,
|
afterUpdate,
|
||||||
|
onDestroy,
|
||||||
} from "svelte";
|
} from "svelte";
|
||||||
|
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
|
@ -79,12 +80,12 @@
|
||||||
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(() => {
|
||||||
if (opened) {
|
if (opened) {
|
||||||
if (!open) {
|
if (!open) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue