Skip to content

Commit ccc62cc

Browse files
authored
fix(floating-panel): resizable and draggable are now respected (#2861)
1 parent 578ea09 commit ccc62cc

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/three-lines-end.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@zag-js/floating-panel": patch
3+
---
4+
5+
bugfix: `draggable` and `resizable` were not respected when set to `false`

packages/machines/floating-panel/src/floating-panel.machine.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ export const machine = createMachine<FloatingPanelSchema>({
104104
isMaximized: ({ context }) => context.get("stage") === "maximized",
105105
isMinimized: ({ context }) => context.get("stage") === "minimized",
106106
isStaged: ({ context }) => context.get("stage") !== "default",
107-
canResize: ({ context, prop }) => (prop("resizable") || !prop("disabled")) && context.get("stage") === "default",
108-
canDrag: ({ prop, computed }) => (prop("draggable") || !prop("disabled")) && !computed("isMaximized"),
107+
canResize: ({ context, prop }) => prop("resizable") && !prop("disabled") && context.get("stage") === "default",
108+
canDrag: ({ prop, computed }) => prop("draggable") && !prop("disabled") && !computed("isMaximized"),
109109
},
110110

111111
watch({ track, context, action, prop }) {

0 commit comments

Comments
 (0)