smooth-dnd icon indicating copy to clipboard operation
smooth-dnd copied to clipboard

Select element for the draggable wrapper

Open skoulix opened this issue 6 years ago • 6 comments

We can select the container element during initialization. Is there any way that I can select which element is going to be the draggable wrapper.

The reason for asking this is because I'm trying to make the plugin work with table rows. I can select the tbody as the container but after initialization the plugin inserts an additional div for the draggable element, after the tbody and before the tr element and the tables breaks, as expected.

Thanks for this great plugin.

skoulix avatar Oct 17 '18 17:10 skoulix

Could you fix this? I've solved this by using the Draggable's render method.

juanrisso avatar Aug 26 '19 19:08 juanrisso

@juanrisso can you please explain a little bit how did you solve the issue? In my case I too want to modify the wrapper. At this time I am overriding the parent element(i.e. wrapper element provided by the library) of draggable by my own wrapper in the onDrop function but when I drag and drop really fast, it breaks the code.

SarthakSri98 avatar Apr 30 '20 12:04 SarthakSri98

@SarthakSri98 Some time ago we switched the library to react-list-drag-and-drop because of that problem. Sorry, I cant help you

juanrisso avatar Apr 30 '20 13:04 juanrisso

Same here, I ended up using another library for the reason that I'm describing in my initial post.

skoulix avatar Apr 30 '20 15:04 skoulix

@skoulix okay, can you please tell me what library you used?

SarthakSri98 avatar May 01 '20 05:05 SarthakSri98

@skoulix okay, can you please tell me what library you used?

So many libraries out there... When I posted this comment 2 years ago I was working on a specific project. For that project I used this one https://sortablejs.github.io/Vue.Draggable since it was a Vue.js project. Also another feature rich library I stumbled upon is this one https://shopify.github.io/draggable/

I hope this helps.

skoulix avatar May 01 '20 08:05 skoulix