Skip to content

Commit

Permalink
Fix a bug which would lock scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
Dlurak committed Sep 4, 2024
1 parent 4e591f9 commit d302a44
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/components/modal/Modal.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { openedModals } from '$lib/stores';
import { enableScrolling } from '$lib/utils/dom/scroll';
import { createEventDispatcher } from 'svelte';
import { createEventDispatcher, onDestroy } from 'svelte';
import { Icon, XMark } from 'svelte-hero-icons';
const dispatch = createEventDispatcher<{ open: null; close: null }>();
Expand Down Expand Up @@ -35,6 +35,11 @@
if (isOpen) open();
else close();
}
onDestroy(() => {
openedModals.dec();
enableScrolling(true);
});
</script>

<dialog
Expand Down

0 comments on commit d302a44

Please sign in to comment.