From 8cb0620472523c196ed39523b2793db514f59d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E9=9B=86?= <16908091@qq.com> Date: Fri, 8 Sep 2017 10:55:22 +0800 Subject: [PATCH] fix: touchmove run once on android --- components/SwipeAction/SwipeAction.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/SwipeAction/SwipeAction.jsx b/components/SwipeAction/SwipeAction.jsx index b14587f8e..6d6070bd8 100644 --- a/components/SwipeAction/SwipeAction.jsx +++ b/components/SwipeAction/SwipeAction.jsx @@ -26,6 +26,7 @@ class SwipeAction extends PureComponent { } onDragStart() { + event.preventDefault(); if (this.isOpen) { this.touchEnd = false; this.close(); @@ -35,6 +36,7 @@ class SwipeAction extends PureComponent { } onDragMove(event, { offsetX, offsetY }) { + event.preventDefault(); if (!this.touchEnd) return; const { disabled } = this.props; @@ -59,7 +61,6 @@ class SwipeAction extends PureComponent { onDragEnd(event, { offsetX, startTime }) { event.preventDefault(); - const { duration, moveDistanceRatio, moveTimeSpan } = this.props; const timeSpan = new Date().getTime() - startTime.getTime(); const btnsLeftWidth = this.left && this.left.offsetWidth;