diff --git a/dist/index.es.js b/dist/index.es.js index 13342d5..c185eba 100644 --- a/dist/index.es.js +++ b/dist/index.es.js @@ -151,7 +151,7 @@ function handleStateAdd(normalized, list) { return newList; } function getMode(evt) { - if (evt.oldIndicies.length > 0) + if (evt.oldIndicies && evt.oldIndicies.length > 0) return "multidrag"; if (evt.swapItem) return "swap"; diff --git a/dist/index.js b/dist/index.js index d6b6d4d..40701dd 100644 --- a/dist/index.js +++ b/dist/index.js @@ -157,7 +157,7 @@ function handleStateAdd(normalized, list) { return newList; } function getMode(evt) { - if (evt.oldIndicies.length > 0) + if (evt.oldIndicies && evt.oldIndicies.length > 0) return "multidrag"; if (evt.swapItem) return "swap"; diff --git a/src/util.ts b/src/util.ts index d317276..2368e1b 100644 --- a/src/util.ts +++ b/src/util.ts @@ -124,7 +124,7 @@ export function handleStateAdd( } export function getMode(evt: MultiDragEvent) { - if (evt.oldIndicies.length > 0) return "multidrag"; + if (evt.oldIndicies && evt.oldIndicies.length > 0) return "multidrag"; if (evt.swapItem) return "swap"; return "normal"; }