desandro / draggabilly

:point_down: Make that shiz draggable
https://draggabilly.desandro.com
MIT License
3.86k stars 386 forks source link

Allow handle to be an array of HTMLElement #166

Closed kftang closed 2 years ago

kftang commented 7 years ago

I'm using Vue.js and found it to be quite difficult to get a selector string from an HTMLElement so something like this could make it much easier.

desandro commented 7 years ago

Thank you for this contribution! I like how this is a nice improvement. I like the feature, but I might implement differently to match Draggabilly's code style. I'll follow up in a subsequent release.

desandro commented 2 years ago

Draggabilly v3 has been released, now with updated handle behavior. You can set it to a single element or a Array or NodeList of elements

// select all .handle children with selector string
handle: '.handle'

// set as element
handle: element.querySelector('.handle')

// set as array or NodeList
handle: [ element.querySelector('.handle1'), element.querySelector('.handle2') ]

Please try it out and report back with any issues!