Open renzhiVivio opened 1 year ago
Hello renzhiVivio,
I have solved the problem using the following approach:
const dragHandler = (e: DraggableEvent, data: DraggableData): void => {
data.node.style.rotate = ${360 + (data.x / 50)}deg;
}
Please let me know if you have any questions or concerns.
Hi @svasighi , could you provide how to use the dragHandler
If someone has the same problem as above, replace Draggable with DraggableCore, because Draggable implements some display logic and is a wrapper around DraggableCore, when now using DraggableCore, you have full control of the placement of the draggable
I create a DOM in react-draggable, now I rotate the DOM
since react-draggable will set a transform property inside the DOM when render, it makes my transform rotate properties not working properly
for example, the DOM css is
transform: translate(265px, 262px)
, but what I want istransform: translate(265px, 262px) rotate(33deg)
how can I acquire?
the blue rect shadow DOM indicating react-draggable, which doesn't rotate