-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disabled plugins should not bind events #1611
Comments
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 |
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
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. Also, you could create a separate folder and just build the modular versions yourself without MultiDrag and it should give you a UMD. |
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).
I'm going to do this for now, thanks. |
I solved the bug so I will close this |
Problem:
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
document
are still set, regardless ifmultiDrag
is set totrue
orfalse
.Another idea would be to introduce a method inside
PluginManager
to unmount plugins.The text was updated successfully, but these errors were encountered: