Skip to content

Commit 171b92e

Browse files
alexandcoteClaudéric Demers
authored and
Claudéric Demers
committed
Fix a bug when you use SortableHandle and distance prop. (#447)
1 parent a13b190 commit 171b92e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/SortableContainer/index.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -225,18 +225,18 @@ export default function sortableContainer(WrappedComponent, config = {withRef: f
225225
};
226226

227227
handleEnd = () => {
228-
const {distance} = this.props;
229-
230228
this._touched = false;
231-
232-
if (!distance) {
233-
this.cancel();
234-
}
229+
this.cancel();
235230
};
236231

237232
cancel = () => {
238-
if (!this.state.sorting) {
239-
clearTimeout(this.pressTimer);
233+
const {distance} = this.props;
234+
const {sorting} = this.state;
235+
236+
if (!sorting) {
237+
if (!distance) {
238+
clearTimeout(this.pressTimer);
239+
}
240240
this.manager.active = null;
241241
}
242242
};

0 commit comments

Comments
 (0)