Skip to content

Commit 415a206

Browse files
author
Szabolcs Szoke
committed
Fixes "Cannot read property 'collection' of null" when distance is a disabled element is moved
1 parent 3245c5e commit 415a206

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Manager.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ export default class Manager {
2020
}
2121
}
2222

23+
isActive() {
24+
return this.active;
25+
}
26+
2327
getActive() {
2428
return find(
2529
this.refs[this.active.collection],

src/SortableContainer/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export default function sortableContainer(WrappedComponent, config = {withRef: f
205205
if (!distance && (!pressThreshold || pressThreshold && delta >= pressThreshold)) {
206206
clearTimeout(this.cancelTimer);
207207
this.cancelTimer = setTimeout(this.cancel, 0);
208-
} else if (distance && delta >= distance) {
208+
} else if (distance && delta >= distance && this.manager.isActive()) {
209209
this.handlePress(e);
210210
}
211211
}

0 commit comments

Comments
 (0)