fix a bug where placement indicator doesn't show

This commit is contained in:
Roman Pominov committed 2022-08-04 11:01:52 +03:00
1 parent 92f3120769
commit 4708bfd8de
1 file changed
+3 -1
@@ -12,7 +12,9 @@ export const useSubscribeDragAndDropState = () => {
useSubscribe<"dragStart", DragStartPayload>(
"dragStart",
({ origin, dragItem }) => {
setState({ isDragging: true, origin, dragItem });
// It's possible that dropTargetChange comes before dragStart.
// Sot it's important to spread the current ...state here.
setState({ ...state, isDragging: true, origin, dragItem });
}
);