8000 [bugfix] uses newIndicies with error handling instead of oldIndicies … · andrewvmail/react-sortablejs@7703081 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7703081

Browse files
author
Wayne Van Son
committed
[bugfix] uses newIndicies with error handling instead of oldIndicies without it.
1 parent c6dd6e5 commit 7703081

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/react-sortable.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,9 @@ Please read the updated README.md at https://github.com/SortableJS/react-sortabl
319319
onDeselect(evt: MultiDragEvent) {
320320
const { list, setList } = this.props;
321321
const newList = [...list].map(item => ({ ...item, selected: false }));
322-
evt.oldIndicies.forEach(curr => {
322+
evt.newIndicies.forEach(curr => {
323323
const index = curr.index;
324+
if (index === -1) return;
324325
newList[index].selected = true;
325326
});
326327
setList(newList, this.sortable, store);

0 commit comments

Comments
 (0)
0