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.19k stars 782 forks source link

The draggable element hide or change its position when I resize the chrome window #1039

Open ziaKhan1995 opened 1 month ago

ziaKhan1995 commented 1 month ago

Thanks for this library.

Expected behavior

The dragged element must maintain its position where it was dragged.

Actual behavior

Does not maintain its position both on window resize and also on other screens.

is there any consistent way to maintain its position both by resizing of window and also on other screens?

Thanks in advance.

System configuration

interact.js version: 1.10.27 Browser name and version: chrome 124.0.6367.202 (Official Build) (64-bit) Operating System: window

BloodSeaker commented 1 month ago

If you read the docs, it says you are responsible for the positioning of the element. THe library only gives you events on the position of the dragged element and on droppable areas. So, if you want it to behave correctly on repositioning when changing window size, you need to do the calculations yourself ;)