Skip to content

Commit

Permalink
fix: make sure the droppable exsist in the registry before notify a r…
Browse files Browse the repository at this point in the history
…emoval (#392)
  • Loading branch information
100terres committed Aug 21, 2022
1 parent 3ca8100 commit 8648c80
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/state/registry/create-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ export default function createRegistry(): Registry {
}

delete entries.draggables[draggableId];
notify({ type: 'REMOVAL', value: entry });

// make sure the entry exists before removal
if (entries.droppables[entry.descriptor.droppableId]) {
notify({ type: 'REMOVAL', value: entry });
}
},
getById: getDraggableById,
findById: findDraggableById,
Expand Down

0 comments on commit 8648c80

Please sign in to comment.