From 09041347bff23e789e1c98c59827bf2325088a08 Mon Sep 17 00:00:00 2001 From: kooriookami <38392315+kooriookami@users.noreply.github.com> Date: Mon, 18 Jan 2021 00:07:48 -0600 Subject: [PATCH] fix(slider): fix slider can't drag in mobile (#1299) --- packages/slider/src/useSliderButton.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/slider/src/useSliderButton.ts b/packages/slider/src/useSliderButton.ts index 3509c32508..3b2b503610 100644 --- a/packages/slider/src/useSliderButton.ts +++ b/packages/slider/src/useSliderButton.ts @@ -106,7 +106,7 @@ export const useSliderButton = (props: ISliderButtonProps, initData: ISliderButt const getClientXY = (event: MouseEvent | TouchEvent) => { let clientX: number let clientY: number - if (event.type === 'touchstart') { + if (event.type.startsWith('touch')) { clientY = (event as TouchEvent).touches[0].clientY clientX = (event as TouchEvent).touches[0].clientX } else {