You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the UMD version of SortableJS which has all plugins already bundled. The multidrag plugin is disabled by default, but the events on documentare still set, regardless if multiDrag is set to true or false.
Another idea would be to introduce a method inside PluginManager to unmount plugins.
This is so that the plugin can be dynamically enabled even after initialisation. Is there a reason the events should not be set?
I'm using it on a legacy project in combination with jQuery (https://github.com/SortableJS/jquery-sortablejs) and need to generate dynamic lists with a SortableJS instance attached to it. This is working but creating new instances of SortableJS also creates multiple events on the document node, since it's always reattaching it.
If you are not using multiDrag at all I would recommend you use the tree-shakeable modular version
Unfortunately not possible, since it's a legacy project.
@OkanEsen I just realized that the multiDrag events may not be being removed from the document if a Sortable is destroyed but multiDrag isn't enabled.
Yeah, exactly. I noticed that the page was becoming a huge resource hog after destroying and creating several instances of SortableJS which were events bound by the MultiDrag plugin (see attachment below).
Details
Also, you could create a separate folder and just build the modular versions yourself without MultiDrag and it should give you a UMD.
Activity
owen-m1 commentedon Aug 23, 2019
This is so that the plugin can be dynamically enabled even after initialisation. Is there a reason the events should not be set?
If you are not using multiDrag at all I would recommend you use the tree-shakeable modular version
OkanEsen commentedon Aug 23, 2019
I'm using it on a legacy project in combination with jQuery (https://github.com/SortableJS/jquery-sortablejs) and need to generate dynamic lists with a SortableJS instance attached to it. This is working but creating new instances of SortableJS also creates multiple events on the
documentnode, since it's always reattaching it.Unfortunately not possible, since it's a legacy project.
owen-m1 commentedon Aug 23, 2019
@OkanEsen I just realized that the multiDrag events may not be being removed from the document if a Sortable is destroyed but multiDrag isn't enabled.
Also, you could create a separate folder and just build the modular versions yourself without MultiDrag and it should give you a UMD.
OkanEsen commentedon Aug 24, 2019
Yeah, exactly. I noticed that the page was becoming a huge resource hog after destroying and creating several instances of SortableJS which were events bound by the MultiDrag plugin (see attachment below).
Details
I'm going to do this for now, thanks.
#1611: Remove MultiDrag events on GLOBAL destroy
owen-m1 commentedon Sep 2, 2019
I solved the bug so I will close this
SortableJS#1611: Remove MultiDrag events on GLOBAL destroy
SortableJS#1611: Remove MultiDrag events on GLOBAL destroy