react-draggable icon indicating copy to clipboard operation
react-draggable copied to clipboard

Dragging resets the rotation transform of child div

Open yardik opened this issue 4 years ago • 0 comments
trafficstars

When structuring a component like this:

<Draggable bounds={{left: -this.props.offsetX, top: -this.props.offsetY}} positionOffset={{x: -(window.innerWidth/2) + this.props.offsetX, y: this.props.offsetY}} grid={[10, 10]}>
    <div style={{border: this.getBorder()}} onClick={this.handleClick} className="outerDraggable"><img draggable={"false"} className="innerDraggable" src={`${this.props.item}`} alt=""/></div>
</Draggable>

If you rotate the inner div at any time (for example: style.transform += "rotate(30deg)") it will be reset the first time you try to drag the draggable.

yardik avatar Jul 07 '21 16:07 yardik