From cc44c06040ffa090b19e82a10a94c1576237a29e Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Wed, 4 Sep 2024 11:36:20 -0500 Subject: [PATCH] touch events --- web/src/hooks/use-draggable-element.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/web/src/hooks/use-draggable-element.ts b/web/src/hooks/use-draggable-element.ts index b8922641e..0168cd5a2 100644 --- a/web/src/hooks/use-draggable-element.ts +++ b/web/src/hooks/use-draggable-element.ts @@ -547,11 +547,20 @@ function useDraggableElement({ timelineElement.addEventListener("scroll", handleUserInteraction); timelineElement.addEventListener("mousedown", handleUserInteraction); timelineElement.addEventListener("mouseup", handleUserInteraction); + timelineElement.addEventListener("touchstart", handleUserInteraction); + timelineElement.addEventListener("touchmove", handleUserInteraction); + timelineElement.addEventListener("touchend", handleUserInteraction); return () => { timelineElement.removeEventListener("scroll", handleUserInteraction); timelineElement.removeEventListener("mousedown", handleUserInteraction); timelineElement.removeEventListener("mouseup", handleUserInteraction); + timelineElement.removeEventListener( + "touchstart", + handleUserInteraction, + ); + timelineElement.removeEventListener("touchmove", handleUserInteraction); + timelineElement.removeEventListener("touchend", handleUserInteraction); }; } }, [timelineRef]);