Skip to content

Commit bda16e8

Browse files
committed
Use data-grid co-ordinates when updating layout
This should solve this problem: react-grid-layout#382 But may have unwanted side effects if you're relying on the global `layout` array.
1 parent b839cd5 commit bda16e8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/ReactGridLayout.jsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,14 @@ export default class ReactGridLayout extends React.Component {
390390
if (!child.key) return;
391391
const l = getLayoutItem(this.state.layout, child.key);
392392
if (!l) return null;
393+
394+
if (child.props['data-grid']) {
395+
l.h = child.props['data-grid'].h;
396+
l.w = child.props['data-grid'].w;
397+
l.x = child.props['data-grid'].x;
398+
l.y = child.props['data-grid'].y;
399+
}
400+
393401
const {width, cols, margin, containerPadding, rowHeight,
394402
maxRows, isDraggable, isResizable, useCSSTransforms,
395403
draggableCancel, draggableHandle} = this.props;

0 commit comments

Comments
 (0)