Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export type HandleComponent = {
bottomRight?: React.ReactElement<any>;
bottomLeft?: React.ReactElement<any>;
topLeft?: React.ReactElement<any>;
}
};

export interface Props {
dragGrid?: Grid;
Expand Down Expand Up @@ -363,8 +363,11 @@ export class Rnd extends React.PureComponent<Props, State> {
this.resizing = true;

const scale = this.props.scale as number;
const offset = this.getOffsetFromParent();
const pos = this.getDraggablePosition();
this.resizingPosition = { x: pos.x + offset.left, y: pos.y + offset.top };
this.setState({
original: this.getDraggablePosition(),
original: pos,
});
if (this.props.bounds) {
const parent = this.getParent();
Expand Down Expand Up @@ -587,7 +590,7 @@ export class Rnd extends React.PureComponent<Props, State> {
};
}
// INFO: Make uncontorolled component when resizing to control position by setPostion.
const pos = this.resizing ? undefined : draggablePosition
const pos = this.resizing ? undefined : draggablePosition;
return (
<Draggable
ref={this.refDraggable}
Expand Down