fix: prevent swipe navigation when scrolling someday area
Ignore horizontal swipe gestures that originate inside the .weekly-someday element so that horizontal scrolling of someday lists works without triggering day navigation on mobile. v1.35.1 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e663f82c26
commit
914b1d76b2
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "my-weekly-todo-list",
|
||||
"version": "1.35.0",
|
||||
"version": "1.35.1",
|
||||
"description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@ -3518,12 +3518,17 @@ export default function WeeklyView() {
|
||||
let touchEndX = 0;
|
||||
let touchEndY = 0;
|
||||
|
||||
let touchStartedInSomeday = false;
|
||||
|
||||
const handleTouchStart = (e: TouchEvent) => {
|
||||
touchStartX = e.changedTouches[0].screenX;
|
||||
touchStartY = e.changedTouches[0].screenY;
|
||||
// Check if touch started inside the someday area (which has its own horizontal scroll)
|
||||
touchStartedInSomeday = !!(e.target as HTMLElement)?.closest?.('.weekly-someday');
|
||||
};
|
||||
|
||||
const handleTouchEnd = (e: TouchEvent) => {
|
||||
if (touchStartedInSomeday) return; // Don't hijack someday horizontal scrolling
|
||||
touchEndX = e.changedTouches[0].screenX;
|
||||
touchEndY = e.changedTouches[0].screenY;
|
||||
const diffX = touchEndX - touchStartX;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user