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.

cancel on esc

Roman Pominov472dce8fb86a
diff --git a/apps/designer/app/designer/shared/tree/sortable-tree.tsx b/apps/designer/app/designer/shared/tree/sortable-tree.tsx
index dcbbd762f7..6a6bc3b1fa 100644
--- a/apps/designer/app/designer/shared/tree/sortable-tree.tsx
+++ b/apps/designer/app/designer/shared/tree/sortable-tree.tsx
@@ -1,5 +1,9 @@
import { useState, useMemo, useRef } from "react";
-import { type Instance, components } from "@webstudio-is/react-sdk";
+import {
+ type Instance,
+ components,
+ useSubscribe,
+} from "@webstudio-is/react-sdk";
import {
type DropTarget,
type Rect,
@@ -314,6 +318,10 @@ export const SortableTree = ({
},
});
+ useSubscribe("cancelCurrentDrag", () => {
+ dragHandlers.cancelCurrentDrag();
+ });
+
const autoScrollHandlers = useAutoScroll();
return (