Skip to content

Commit 99c8695

Browse files
committed
#1514: Add conditional for rootEl
1 parent a8836d5 commit 99c8695

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

scripts/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ createTestCafe().then((tc) => {
1010
runner = tc.createRunner();
1111
return runner
1212
.src('./tests/Sortable.test.js')
13-
.browsers('chrome')
13+
.browsers('chrome:headless')
1414
.concurrency(3)
1515
.run();
1616
}).then((actualFailedCount) => {

src/EventDispatcher.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ export default function dispatchEvent(
1111
originalEvent, putSortable, eventOptions
1212
}
1313
) {
14-
sortable = (sortable || rootEl[expando]);
14+
sortable = (sortable || (rootEl && rootEl[expando]));
15+
if (!sortable) return;
16+
1517
let evt,
1618
options = sortable.options,
1719
onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);

0 commit comments

Comments
 (0)