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: fix drag&drop issues (#2462)

Bogdan Chadkin331cbea83564
diff --git a/apps/builder/app/shared/instance-utils.ts b/apps/builder/app/shared/instance-utils.ts
index 87bd757e01..2a14ff40f8 100644
--- a/apps/builder/app/shared/instance-utils.ts
+++ b/apps/builder/app/shared/instance-utils.ts
@@ -107,7 +107,7 @@ export const findClosestDetachableInstanceSelector = (
return;
}
const detachable = meta.detachable ?? true;
- if (meta.type !== "container" || detachable === false) {
+ if (meta.type === "rich-text-child" || detachable === false) {
continue;
}
return getAncestorInstanceSelector(instanceSelector, instanceId);
diff --git a/apps/builder/app/shared/sync/sync-stores.ts b/apps/builder/app/shared/sync/sync-stores.ts
index 1aa4053cd6..6a10d714e4 100644
--- a/apps/builder/app/shared/sync/sync-stores.ts
+++ b/apps/builder/app/shared/sync/sync-stores.ts
@@ -29,6 +29,7 @@ import {
selectedStyleSourceSelectorStore,
synchronizedComponentsMetaStores,
dataSourceVariablesStore,
+ $dragAndDropState,
} from "~/shared/nano-states";
enableMapSet();
@@ -102,6 +103,7 @@ export const registerContainers = () => {
"selectedStyleSourceSelector",
selectedStyleSourceSelectorStore
);
+ clientStores.set("dragAndDropState", $dragAndDropState);
for (const [name, store] of synchronizedBreakpointsStores) {
clientStores.set(name, store);
}
diff --git a/packages/design-system/src/components/primitives/dnd/placement-indicator.tsx b/packages/design-system/src/components/primitives/dnd/placement-indicator.tsx
index 2afe02f6d4..795fea6619 100644
--- a/packages/design-system/src/components/primitives/dnd/placement-indicator.tsx
+++ b/packages/design-system/src/components/primitives/dnd/placement-indicator.tsx
@@ -47,7 +47,7 @@ const applyScale = (rect: Rect, scale: number) => {
export const PlacementIndicator = ({
placement,
- scale = 1,
+ scale = 100,
}: {
placement: Placement;
scale?: number;