Skip to content

Commit

Permalink
fix: touchmove run once on android
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeLin committed Sep 8, 2017
1 parent 7f3bfbd commit 8cb0620
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/SwipeAction/SwipeAction.jsx
Expand Up @@ -26,6 +26,7 @@ class SwipeAction extends PureComponent {
}

onDragStart() {
event.preventDefault();
if (this.isOpen) {
this.touchEnd = false;
this.close();
Expand All @@ -35,6 +36,7 @@ class SwipeAction extends PureComponent {
}

onDragMove(event, { offsetX, offsetY }) {
event.preventDefault();
if (!this.touchEnd) return;

const { disabled } = this.props;
Expand All @@ -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;
Expand Down

0 comments on commit 8cb0620

Please sign in to comment.