Skip to content

Commit 4581bfd

Browse files
committedNov 23, 2024··
feat(update): minor changes
1 parent 8025d33 commit 4581bfd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎src/features/sort/hooks/useDraggableStack.ts

+5
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ export const useDraggableStack = ({
5757
if (siblingId === id) {
5858
continue;
5959
}
60+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
61+
if (!layouts[siblingId]) {
62+
// Can happen if some items are being removed from the stack
63+
continue;
64+
}
6065
const prevSiblingIndex = initialOrder.findIndex((itemId) => itemId === siblingId);
6166
// Accummulate the directional offset for the active item
6267
if (nextSiblingIndex < nextIndex && prevSiblingIndex > prevIndex) {

0 commit comments

Comments
 (0)
Please sign in to comment.