From 4708bfd8deb3c3032e2ed2e254a736cccc3a9d29 Mon Sep 17 00:00:00 2001 From: Roman Pominov Date: Thu, 4 Aug 2022 11:01:52 +0300 Subject: [PATCH] fix a bug where placement indicator doesn't show --- .../app/shared/nano-states/use-subscribe-drag-drop-state.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/designer/app/shared/nano-states/use-subscribe-drag-drop-state.ts b/apps/designer/app/shared/nano-states/use-subscribe-drag-drop-state.ts index 80923995ca..616bda5815 100644 --- a/apps/designer/app/shared/nano-states/use-subscribe-drag-drop-state.ts +++ b/apps/designer/app/shared/nano-states/use-subscribe-drag-drop-state.ts @@ -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 }); } );