Skip to content

Commit

Permalink
Use data-grid co-ordinates when updating layout
Browse files Browse the repository at this point in the history
This should solve this problem:
react-grid-layout#382

But may have unwanted side effects if you're relying on the global
`layout` array.
  • Loading branch information
nikolas committed Dec 21, 2016
1 parent b839cd5 commit bda16e8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/ReactGridLayout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,14 @@ export default class ReactGridLayout extends React.Component {
if (!child.key) return;
const l = getLayoutItem(this.state.layout, child.key);
if (!l) return null;

if (child.props['data-grid']) {
l.h = child.props['data-grid'].h;
l.w = child.props['data-grid'].w;
l.x = child.props['data-grid'].x;
l.y = child.props['data-grid'].y;
}

const {width, cols, margin, containerPadding, rowHeight,
maxRows, isDraggable, isResizable, useCSSTransforms,
draggableCancel, draggableHandle} = this.props;
Expand Down

0 comments on commit bda16e8

Please sign in to comment.