Closed toanqc closed 7 years ago
Haven't actually tried doing something like this. But I'll have a look.
@toanqc with v1.0.0 release you can't add draggable
& droppable
directives to the same element but it will not work since droppable explicitly disables drag on an element.
Can you explain the use case of making an element draggable
and droppable
at the same time?
I was wondering if the new example I added is what you had in mind: http://plnkr.co/edit/ki2TgX?p=preview (See the swap list demo)
I have a nested folder/file structure. I want to drag and drop a folder to another folder and file also is able to drag and drop into the folder. So in this case, the folder is both draggable and droppable.
@toanqc, in the v1.2.0 release I have removed the draggable=false
attribute on droppable
. Now you can easily implement the required functionality.
Is this feature not supported right now?
Because I marked a div as both draggable and droppable then I get the error below:
SyntaxError: Unexpected token u in JSON at position 0 at JSON.parse ()
at Droppable.drop (droppable.js:51)
at Wrapper_Droppable.handleEvent (/Ng2DragDropModule/Droppable/wrapper.ngfactory.js:74)
at View_NavverItemComponent3.handleEvent_0 (/DashboardModule/NavverItemComponent/component.ngfactory.js:708)
Thank you!