Skip to content

Commit cdb432b

Browse files
author
Wayne Van Son
committed
handles undefined values from props.onMove
1 parent e36dcaa commit cdb432b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/react-sortable.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,9 @@ Please read the updated README.md at https://github.com/SortableJS/react-sortabl
175175
const { onMove } = this.props;
176176
const defaultValue = evt.willInsertAfter || -1;
177177
if (!onMove) return defaultValue;
178-
return onMove(evt, originalEvt, this.sortable, store);
178+
const result = onMove(evt, originalEvt, this.sortable, store);
179+
if (typeof result === 'undefined') return false
180+
return result
179181
};
180182

181183
return {

0 commit comments

Comments
 (0)