Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
initialize() {
this.sortable = new Sortable(this.$el, {
draggable: `.${SORTABLE_CLASS}`,
handle: `.${HANDLE_CLASS}`,
delay: 250,
mirror: {
constrainDimensions: true,
xAxis: false,
},
plugins: [Plugins.SwapAnimation],
});
// Remove default focusable plugin and undo damage.
// ref: https://github.com/Shopify/draggable/issues/317
this.sortable.removePlugin(Draggable.Plugins.Focusable);
this.$el.tabIndex = -1;
Array.from(this.$el.children).forEach(child => (child.tabIndex = -1));