Issue: Dragging Disabled When Applying none Variant with Custom Transform
When using the following variants:
const variants: Variants = {
// ...other variants
none: (custom) => ({
width: "fit-content",
height: "fit-content",
transform: custom || undefined,
}),
} as const;
I apply the none variant with a custom transform. The custom transform is supposed to restore the position to a previous drag state. However, when the none variant is applied, it disables the drag transformation, preventing the window from moving.
Minimal Code Example
<motion.div
ref={winRef}
custom={positionBackup.current}
initial="none"
animate={isMaximize ? "maximize" : "none"}
variants={variants}
drag={!isMaximize}
dragListener={false}
dragControls={dragControls}
dragMomentum={false}
dragConstraints={winContainer ?? {}}
></motion.div>;
More Details
I am building a window component similar to a Windows OS window. I want the user to drag the window using the title bar.

Issue: Dragging Disabled When Applying
noneVariant with Custom TransformWhen using the following variants:
I apply the
nonevariant with a custom transform. Thecustomtransform is supposed to restore the position to a previous drag state. However, when thenonevariant is applied, it disables the drag transformation, preventing the window from moving.Minimal Code Example
More Details
I am building a window component similar to a
WindowsOS window. I want the user to drag the window using the title bar.