Fix fit-to-screen drag: use noCompactor for free horizontal movement

In fit-to-screen mode, pass noCompactor to <Responsive> so elements
follow the mouse freely without vertical compaction pushing them down.
The swap-on-drop logic (mouse coordinates in onDragStop) stays unchanged.

https://claude.ai/code/session_01Cu7YDRKZrYX3sBs6g9w2dy
This commit is contained in:
Claude 2026-03-22 00:31:56 +00:00
parent 29e2003a84
commit 8fc7f6bdb7
No known key found for this signature in database

View File

@ -16,6 +16,7 @@ import {
Layout, Layout,
LayoutItem, LayoutItem,
ResponsiveGridLayout as Responsive, ResponsiveGridLayout as Responsive,
noCompactor,
} from "react-grid-layout"; } from "react-grid-layout";
import "react-grid-layout/css/styles.css"; import "react-grid-layout/css/styles.css";
import "react-resizable/css/styles.css"; import "react-resizable/css/styles.css";
@ -920,6 +921,7 @@ export default function DraggableGridLayout({
{containerWidth > 0 && <Responsive {containerWidth > 0 && <Responsive
className="grid-layout" className="grid-layout"
width={availableWidth} width={availableWidth}
compactor={fitToScreen ? noCompactor : undefined}
layouts={{ layouts={{
lg: activeGridLayout, lg: activeGridLayout,
md: activeGridLayout, md: activeGridLayout,