taye / interact.js

JavaScript drag and drop, resizing and multi-touch gestures with inertia and snapping for modern browsers (and also IE9+)
http://interactjs.io/
MIT License
12.32k stars 783 forks source link

Element teleported after change position programatically #960

Closed N445 closed 2 years ago

N445 commented 2 years ago

Expected behavior

Change programatically position of draggable zone

$(element).css('top','50px');

The element was moved. When I drag and drop, the element was moved from the edited placment

Actual behavior

My element was teleported to another place

System configuration

1.10.11: Firefox 98.0.1: Linux mint:

taye commented 2 years ago

You'll have to read the dragged position (element.dataset.x and .y if you're using the examples from the interactjs.io demos) and calculate the new position using those values.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.