react-draggable
react-draggable copied to clipboard
Dragging resets the rotation transform of child div
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.