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 in findClosestDropTarget

Roman Pominov6c87d22bf781
diff --git a/apps/designer/app/shared/design-system/components/primitives/dnd/use-drop-target.ts b/apps/designer/app/shared/design-system/components/primitives/dnd/use-drop-target.ts
index d979b0fcfb..c56b669978 100644
--- a/apps/designer/app/shared/design-system/components/primitives/dnd/use-drop-target.ts
+++ b/apps/designer/app/shared/design-system/components/primitives/dnd/use-drop-target.ts
@@ -164,7 +164,7 @@ const findClosestDropTarget = ({
while (currentTarget !== null && currentTarget !== root) {
const isValid = isDropTarget(currentTarget);
if (isValid) {
- return target;
+ return currentTarget;
}
currentTarget = currentTarget.parentElement;
}