mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11: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,
|
||||
onMount,
|
||||
afterUpdate,
|
||||
onDestroy,
|
||||
} from "svelte";
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
@ -79,12 +80,12 @@
|
|||
onMount(async () => {
|
||||
await tick();
|
||||
focus();
|
||||
|
||||
return () => {
|
||||
document.body.classList.remove("bx--body--with-modal-open");
|
||||
};
|
||||
});
|
||||
|
||||
onDestroy(() => {
|
||||
document.body.classList.remove("bx--body--with-modal-open");
|
||||
})
|
||||
|
||||
afterUpdate(() => {
|
||||
if (opened) {
|
||||
if (!open) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue