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.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
fix a case when dragging inline instance on canvas
Roman Pominov3007a9a3328f
diff --git a/apps/designer/app/canvas/shared/use-drag-drop.ts b/apps/designer/app/canvas/shared/use-drag-drop.tsindex f24b305f49..519c3680f6 100644--- a/apps/designer/app/canvas/shared/use-drag-drop.ts+++ b/apps/designer/app/canvas/shared/use-drag-drop.ts@@ -167,6 +167,22 @@ export const useDragAndDrop = () => {return false;}+ // When trying to drag an inline instance, drag its parent instead+ if (components[instance.component].isInlineOnly) {+ const path = getInstancePath(rootInstance, instance.id);+ path.reverse();+ const nonInlineParent = path.find(+ (item) => components[item.component].isInlineOnly === false+ );+ if (+ nonInlineParent !== undefined &&+ rootInstance.id !== nonInlineParent.id+ ) {+ return nonInlineParent;+ }+ return false;+ }+return instance;},onStart({ data: instance }) {