fix(slider): fix slider can't drag in mobile (#1299)

This commit is contained in:
kooriookami 2021-01-18 00:07:48 -06:00 committed by GitHub
parent 89bc84e5e5
commit 09041347bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {