Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

fix a bug where placement indicator doesn't show

Roman Pominov4708bfd8deb3
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 });
}
);