Skip to content

Commit f5ed06d

Browse files
committed
chore(DraggableStack): reset expected order on children update (fixes #37)
1 parent bb189c7 commit f5ed06d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/components/Draggable.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,12 @@ export const Draggable: FunctionComponent<PropsWithChildren<DraggableProps>> = (
6161
zIndex,
6262
transform: [
6363
{
64-
// translateX: offset.x.value,
6564
translateX:
6665
isActive || isSleeping || isActing
6766
? offset.x.value
6867
: withSpring(offset.x.value, { damping: 100, stiffness: 1000 }),
6968
},
7069
{
71-
// translateY: offset.y.value,
7270
translateY:
7371
isActive || isSleeping || isActing
7472
? offset.y.value

src/features/sort/hooks/useDraggableStack.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ export const useDraggableStack = ({
124124
if (arraysEqual(next, prev)) {
125125
return;
126126
}
127+
// Reset the expected sort order
128+
draggableSortOrder.value = next;
127129
// Refresh all offsets
128130
refreshOffsets();
129131
},

0 commit comments

Comments
 (0)