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.38k stars 785 forks source link

Weird resizing bug after removing and re-adding an element to the DOM #680

Closed EddyVinck closed 5 years ago

EddyVinck commented 5 years ago

I believe this will be hard to reproduce in a demo, so I will just link to my repo. The bug is still available when checking out this commit. I fixed it in this commit.

I found the cause of the bug and fixed it by removing some settings, but this might be of interest to maintainers of InteractJS.

A bit of context: I am recreating Windows XP for fun, so when I write 'minimize' you can probably figure out what I mean, but the element is removed from the DOM and kept in memory inside a property of the object.

Expected behavior

Resizing from the bottom, bottom left corner or the bottom right corner should not mess up the size of the element after removing and adding it to the DOM.

Actual behavior

I also added these notes to my fix, but here they are:

Resizing caused the element's window shrink to it's smallest height possible after being minimized, then unminimized and then resized from the bottom, bottom left corner or the bottom right corner.

System configuration

interact.js version: "^1.3.4" Browser name and version: Chrome 70.0.3538.102 (Official Build) (64-bit) Operating System: Ubuntu 18.04

I hope this helps!

stale[bot] commented 5 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.