From 945af85e57dfa1683b6dba4b9285d8ec1ccdd486 Mon Sep 17 00:00:00 2001 From: Wait Date: Mon, 18 Dec 2023 15:55:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(useLongPress):=E7=A7=BB=E5=8A=A8=E6=97=B6?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E9=95=BF=E6=8C=89=E4=BA=8B=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E6=B8=85=E9=99=A4setTimeout=20timerId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/hooks/src/useLongPress/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/hooks/src/useLongPress/index.ts b/packages/hooks/src/useLongPress/index.ts index df3f8be751..a676bcef90 100644 --- a/packages/hooks/src/useLongPress/index.ts +++ b/packages/hooks/src/useLongPress/index.ts @@ -87,7 +87,7 @@ function useLongPress( const onMove = (event: TouchEvent) => { if (timerRef.current && overThreshold(event)) { - clearInterval(timerRef.current); + clearTimeout(timerRef.current); timerRef.current = undefined; } };