aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-05-19 02:09:53 +0000
committerFuwn <[email protected]>2026-05-19 02:09:53 +0000
commitd75a7faf245f0a9e9bcdab41315e7dcdaa76c61b (patch)
tree6fd30447d196031499f44e39ed56e198efa91c01 /src
parentfix(dropdown): scoped transition restores border-radius animation (diff)
downloaddue.moe-d75a7faf245f0a9e9bcdab41315e7dcdaa76c61b.tar.xz
due.moe-d75a7faf245f0a9e9bcdab41315e7dcdaa76c61b.zip
feat(nav): collapse hamburger menu on scroll
When the menu is open and the user scrolls, they have signalled they want to interact with content rather than the menu. Closes isMenuOpen on any scroll event alongside the existing isHeaderVisible recalculation in the same handler.
Diffstat (limited to 'src')
-rw-r--r--src/routes/+layout.svelte2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index af8a0e3c..625f58b1 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -97,6 +97,8 @@ const handleScroll = () => {
currentScrollPosition <= 100 ||
currentScrollPosition < previousScrollPosition;
previousScrollPosition = currentScrollPosition;
+
+ if (isMenuOpen) isMenuOpen = false;
};
onMount(async () => {