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.

We can't close the sidebar if we are dragging from the sidebar

Oleg Isonen63e5eaaa80ea
diff --git a/app/designer/features/sidebar-left/sidebar-left.tsx b/app/designer/features/sidebar-left/sidebar-left.tsx
index c50c946a5e..1db1ba9b93 100644
--- a/app/designer/features/sidebar-left/sidebar-left.tsx
+++ b/app/designer/features/sidebar-left/sidebar-left.tsx
@@ -40,13 +40,17 @@ export const SidebarLeft = ({
const close = useCallback(() => setActiveTab("none"), []);
useSubscribe<"clickCanvas">("clickCanvas", close);
- useSubscribe("dragStartInstance", close);
+ useSubscribe("dragStartInstance", () => {
+ // We can't close the sidebar if we are dragging from the sidebar
+ if (isDragging === true) return;
+ close();
+ });
const handleDragChange = useCallback(
(isDragging: boolean) => {
// After dragging is done, container is going to become visible
// and we need to close it for good.
- if (isDragging === false) close();
+ if (isDragging === false) setActiveTab("none");
setIsDragging(isDragging);
onDragChange(isDragging);
},