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:
Eric Liu 2020-10-20 05:49:11 -07:00 committed by GitHub
commit 350aad83e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) {