I have a set of divs rendered inside a Kendo Sortable component. One of the features of a sortable is you can drag and drop the elements to reorder them. My problem is that each div has an image rendered on a canvas element as a child, and when dragging the div, the canvas is cleared, and immediately re-rendered when dropping. How can I retain the drawn canvas while the card is being dragged?
Asked
Active
Viewed 29 times
0
-
Do you mean the image is not rendered in the hint? If I'm not mistaken, when creating the hint of the dragged element the sortable component Kendo UI relies on [jQuery.clone()](https://api.jquery.com/clone/). [This thread](https://stackoverflow.com/questions/41239428/jquery-clone-does-not-clone-content-of-canvas) explains why the content of a canvas element is not cloned. So one way you could go is cloning the image in the canvas element instead - [example](https://dojo.telerik.com/EHutECal) – Aleksandar Apr 15 '22 at 12:42