Skip to content

Commit 125a855

Browse files
committed
docs: only use swipe gesture to open drawer from screen edge
1 parent 6331151 commit 125a855

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/site/src/routes/__layout.svelte

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,14 @@
542542
mainContentGesture = new TinyGesture(mainContent, {
543543
mouseSupport: false,
544544
});
545+
let touchStartX: number = 0;
546+
mainContentGesture.on('panstart', () => {
547+
touchStartX = mainContentGesture.touchStartX;
548+
});
545549
mainContentGesture.on('swiperight', () => {
546-
drawerOpen = true;
550+
if (touchStartX <= 40) {
551+
drawerOpen = true;
552+
}
547553
});
548554
}
549555

0 commit comments

Comments
 (0)