mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-08 13:05:08 +09:00
We can't close the sidebar if we are dragging from the sidebar
This commit is contained in:
1 parent
5c72ed5a82
commit
63e5eaaa80
1 file changed
+6
-2
@@ -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);
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user