Skip to content

Commit dd4a7f5

Browse files
author
Claudéric Demers
authored
Merge pull request #80 from v0lkan/master
fix: Move cancel to the end of event queue
2 parents b85674a + 998a249 commit dd4a7f5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/SortableContainer/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ export default function sortableContainer(WrappedComponent, config = {withRef: f
146146
const delta = Math.abs(this._delta.x) + Math.abs(this._delta.y);
147147

148148
if (!distance) {
149-
this.cancel();
149+
clearTimeout(this.cancelTimer);
150+
this.cancelTimer = setTimeout(this.cancel, 0);
150151
} else if (delta >= distance) {
151152
this.handlePress(e);
152153
}

0 commit comments

Comments
 (0)