Skip to content

Commit e1a1d16

Browse files
authored
fix: disable nav scroll while menu is open (sveltejs#576)
* fix: disable nav scroll while menu is open * format
1 parent 4e429de commit e1a1d16

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/site-kit/src/lib/nav/Nav.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ Top navigation bar for the application. It provides a slot for the left side, th
4747
last_scroll = scroll;
4848
hash_changed = false;
4949
}
50+
51+
$effect(() => {
52+
document.body.style.overflow = open ? 'hidden' : 'scroll';
53+
});
5054
</script>
5155

5256
<svelte:window

0 commit comments

Comments
 (0)