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 you can't insert at 0 position

Roman Pominovb68181d2c89c
diff --git a/apps/designer/app/canvas/shared/instance.ts b/apps/designer/app/canvas/shared/instance.ts
index bafa5c8da6..e4691b996f 100644
--- a/apps/designer/app/canvas/shared/instance.ts
+++ b/apps/designer/app/canvas/shared/instance.ts
@@ -67,7 +67,7 @@ export const useInsertInstance = () => {
{
parentId:
dropTarget?.instanceId ?? selectedInstance?.id ?? rootInstance.id,
- position: dropTarget?.position || "end",
+ position: dropTarget === undefined ? "end" : dropTarget.position,
}
);
if (hasInserted) {