From 89bcab7b097ac0261cef8cea286d973d07db5648 Mon Sep 17 00:00:00 2001 From: ShuaiKang Zhang Date: Tue, 24 Sep 2019 13:11:12 +0800 Subject: [PATCH] feat(Rate): improve touchmove gesture (#2088) --- packages/rate/index.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/rate/index.ts b/packages/rate/index.ts index b4b82069..b58c6f9e 100644 --- a/packages/rate/index.ts +++ b/packages/rate/index.ts @@ -91,19 +91,13 @@ VantComponent({ const { touchable } = this.data; if (!touchable) return; - const { clientX, clientY } = event.touches[0]; + const { clientX } = event.touches[0]; this.getRect('.van-rate__icon', true).then( (list: WechatMiniprogram.BoundingClientRectCallbackResult[]) => { const target = list .sort(item => item.right - item.left) - .find( - item => - clientX >= item.left && - clientX <= item.right && - clientY >= item.top && - clientY <= item.bottom - ); + .find(item => clientX >= item.left && clientX <= item.right); if (target != null) { this.onSelect({ ...event,