Skip to content

Commit

Permalink
fix(plugins): ignore moutning duplicate plugins
Browse files Browse the repository at this point in the history
closes #1581
  • Loading branch information
waynevanson committed Sep 24, 2020
1 parent 87c3575 commit 6e3ac78
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/sortable/src/PluginManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ const pluginManager = {
plugin[option] = defaults[option];
}
}
plugins.push(plugin);

// only add plugins once, even if they're mounted multiple times
if (!plugins.map((p) => p.name).includes(plugin.name)) {
plugins.push(plugin);
}
},
pluginEvent(eventName, sortable, evt) {
this.eventCanceled = false;
Expand Down

0 comments on commit 6e3ac78

Please sign in to comment.