Conversation
|
I'd like to point out the above fix doesn't fix all cases of items disappearing, only the ones caused by moving alternatively items from different containers. It's still possible to delete components by dropping other components on top of them, from same container. While trying to fix this, I couldn't help but notice listeners stacking on items, which I believe to be the root of the problem. This lib would probably benefit a lot from an overhaul of the events binding and unbinding by either: a) always making sure a binding is not done twice, Cheers. |
|
@andrei-gheorghiu Thanks for that note. I believe you're correct about the duplication., and I agree that everything needs to be checked again with those events. We're working through removing jQuery, anyway. |
|
Closing this as I believe changes in the last several months (including one from this morning) have resolved the referenced issue. Thank you for putting in this PR! Apologies for not getting to it sooner. |
Description
It seems to fix #451 but, since I'm new to Gridstack, I'd like someone with more intimate knowledge looking over proposed changes and figure out if it doesn't have any unwanted implications.
I'm calling
cleanNodes()insideonEndMoving()so whenonStartMoving()is triggered on another gridstack container, current gridstack item doesn't get deleted.This change seems to trigger errors when trying to drag an item in between two different grid containers so I had to add a condition on
gridstack.js:731.Checklist
npm test)Note
For my tests, I have upped
two.htmldependencies to:3.2.0>3.3.71.11.1>3.3.11.11.0>1.12.14.17.0>4.17.101.0.0-devI haven't committed changes made to
two.htmlinto this pull request but I'm ready to, if deemed worthy.