From 412d4db6187c09aa2ca26596daa92942b7107968 Mon Sep 17 00:00:00 2001 From: Ricardo Crespo <9846113+ricardo-crespo@users.noreply.github.com> Date: Sat, 3 Dec 2022 13:03:22 +0100 Subject: [PATCH] avoid pointerUptime update before calculating isDoubleClick (#1055) --- packages/core/src/hooks/useCanvasEvents.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/hooks/useCanvasEvents.tsx b/packages/core/src/hooks/useCanvasEvents.tsx index b357c0084..b704cae30 100644 --- a/packages/core/src/hooks/useCanvasEvents.tsx +++ b/packages/core/src/hooks/useCanvasEvents.tsx @@ -54,6 +54,8 @@ export function useCanvasEvents() { inputs.activePointer = undefined if (!inputs.pointerIsValid(e)) return + const isDoubleClick = inputs.isDoubleClick() + const info = inputs.pointerUp(e, 'canvas') // On right click up @@ -62,8 +64,6 @@ export function useCanvasEvents() { return } - const isDoubleClick = inputs.isDoubleClick() - // Release pointer capture, if any if (e.currentTarget.hasPointerCapture(e.pointerId)) { e.currentTarget?.releasePointerCapture(e.pointerId)