Skip to content

Instantly share code, notes, and snippets.

@ducho
Created October 15, 2021 07:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ducho/cadc78c9f0915466c016c8371cd58122 to your computer and use it in GitHub Desktop.
Save ducho/cadc78c9f0915466c016c8371cd58122 to your computer and use it in GitHub Desktop.
Sortable Stimulus Controller for nested sortable component
import Sortable from "stimulus-sortable"
export default class extends Sortable {
connect() {
super.connect()
this.defaultOptions
}
async end({ item, newIndex }) {
super.end({ item, newIndex });
}
get defaultOptions() {
return {
group: 'nested',
animation: 150,
fallbackOnBody: true,
swapThreshold: 0.65
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment