Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when item is draggable and droppable #13

Closed
toanqc opened this issue Feb 21, 2017 · 5 comments
Closed

Issue when item is draggable and droppable #13

toanqc opened this issue Feb 21, 2017 · 5 comments
Assignees
Labels
Milestone

Comments

@toanqc
Copy link

toanqc commented Feb 21, 2017

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!

@ObaidUrRehman
Copy link
Owner

Haven't actually tried doing something like this. But I'll have a look.

@ObaidUrRehman
Copy link
Owner

@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?

@ObaidUrRehman
Copy link
Owner

ObaidUrRehman commented Mar 7, 2017

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)

@toanqc
Copy link
Author

toanqc commented Mar 7, 2017

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.

@ObaidUrRehman
Copy link
Owner

@toanqc, in the v1.2.0 release I have removed the draggable=false attribute on droppable. Now you can easily implement the required functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants