React-konva move rectangle after rotating its div container


React-konva move rectangle after rotating its div container



I'm using react-konva library to draw a fixed size rectangle. The rectangle has mouse drag events onDragStart and onDragEnd to re-position the rectangle upon dragging it. The event is working fine when the parent div angle (id="parentDiv") is 0 degree. When I try to rotate the div using CSS rotate, the rectangle event doesn't fire and the rectangle doesn't move at all!. I'm totally new to react-konva library and I can't find any case similar to mine.


onDragStart


onDragEnd



The full code for this case (codesandbox) can be found at this link.



If you have any questions let me know in the comments.




1 Answer
1



Currently Konva do not support containers transformed with CSS. It breaks event detection. You can try to rotate a stage or a layer to achieve a similar result.


Konva





thanks sir for your answer, I tried your solution but unfortunately it didn't work. Do you have any other hacks?
– Ibrahim Amer
Jun 30 at 16:39






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

Opening a url is failing in Swift

Possible Unhandled Promise Rejection (id: 0): ReferenceError: user is not defined ReferenceError: user is not defined