Skip to content

Commit

Permalink
fix: timing issue in Chrome caused by setTimeout when pressDelay is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudéric Demers authored Dec 5, 2016
2 parents 5b3c094 + 806685a commit fce6ef1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/SortableContainer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ export default function SortableContainer(WrappedComponent, config = {withRef: f
this.manager.active = {index, collection};

if (!distance) {
this.pressTimer = setTimeout(() => this.handlePress(e), this.props.pressDelay);
if (this.props.pressDelay === 0) {
this.handlePress(e);
} else {
this.pressTimer = setTimeout(() => this.handlePress(e), this.props.pressDelay);
}
}
}
};
Expand Down

0 comments on commit fce6ef1

Please sign in to comment.