Skip to content

Commit aa96307

Browse files
author
Wayne Van Son
authored
Merge pull request #112 from ermyril/master
Added extra checking for existence of oldIndicies
2 parents 3461911 + f960d45 commit aa96307

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

dist/index.es.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ function handleStateAdd(normalized, list) {
151151
return newList;
152152
}
153153
function getMode(evt) {
154-
if (evt.oldIndicies.length > 0)
154+
if (evt.oldIndicies && evt.oldIndicies.length > 0)
155155
return "multidrag";
156156
if (evt.swapItem)
157157
return "swap";

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ function handleStateAdd(normalized, list) {
157157
return newList;
158158
}
159159
function getMode(evt) {
160-
if (evt.oldIndicies.length > 0)
160+
if (evt.oldIndicies && evt.oldIndicies.length > 0)
161161
return "multidrag";
162162
if (evt.swapItem)
163163
return "swap";

src/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export function handleStateAdd<T extends ItemInterface>(
124124
}
125125

126126
export function getMode(evt: MultiDragEvent) {
127-
if (evt.oldIndicies.length > 0) return "multidrag";
127+
if (evt.oldIndicies && evt.oldIndicies.length > 0) return "multidrag";
128128
if (evt.swapItem) return "swap";
129129
return "normal";
130130
}

0 commit comments

Comments
 (0)