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

@angular/cdk/drag-drop: one-way dragging bug #13246

Closed
ptoro opened this issue Sep 21, 2018 · 3 comments · Fixed by #13247
Closed

@angular/cdk/drag-drop: one-way dragging bug #13246

ptoro opened this issue Sep 21, 2018 · 3 comments · Fixed by #13247
Assignees
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@ptoro
Copy link

ptoro commented Sep 21, 2018

Bug, feature request, or proposal:

Bug

Explanation

If you want to only allow one-way dragging (e.g. left list to right list), you remove the connectedTo directive from one of the lists. This causes a problem where if you drag from one list to another list and back to the original list without dropping, the cdkDrag element you dragged won't go back to the original list. Here's a gif that showcases this behavior: cdk drag-drop one-way drag issue reprodution

I can provide a StackBiltz but the only change I had to make from this StackBlitz for the Transferring items between lists example to reproduce this behavior was to remove [connectedTo]="[todoList]" from the donelist's cdkDrop selector. (Side note: I had to copy the StackBlitz code and run it locally because none of the StackBiltzs linked to on this page are working. They either won't drag or it shows an error. I didn't notice anyone else mention this or an existing issue for it.)

@crisbeto crisbeto self-assigned this Sep 21, 2018
crisbeto added a commit to crisbeto/material2 that referenced this issue Sep 21, 2018
…e drag sequence, if not connected to current drag container

Handles the case where the consumer has two drop containers where only one is connected to the other. Currently once the user drags an element outside the first one, they won't be able to return it. With these changes we allow the element to be returned, as long as it hasn't been dropped into the new container.

Fixes angular#13246.
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent has pr labels Sep 21, 2018
@ptoro
Copy link
Author

ptoro commented Sep 22, 2018

Thanks for the PR for this @crisbeto.

Should I create a separate issue for the StackBlitzs not working? I didn't see a resolution for that in this PR but I'm not sure if it's something that should have an issue associated with it since it's probably not considered part of the code base.

@crisbeto
Copy link
Member

The linked Stackblitz doesn't work, because the drag&drop isn't in the latest stable version yet. Once 7.0.0 final is released, it'll work.

jelbourn pushed a commit that referenced this issue Sep 25, 2018
…e drag sequence, if not connected to current drag container (#13247)

Handles the case where the consumer has two drop containers where only one is connected to the other. Currently once the user drags an element outside the first one, they won't be able to return it. With these changes we allow the element to be returned, as long as it hasn't been dropped into the new container.

Fixes #13246.
roboshoes pushed a commit to roboshoes/material2 that referenced this issue Oct 23, 2018
…e drag sequence, if not connected to current drag container (angular#13247)

Handles the case where the consumer has two drop containers where only one is connected to the other. Currently once the user drags an element outside the first one, they won't be able to return it. With these changes we allow the element to be returned, as long as it hasn't been dropped into the new container.

Fixes angular#13246.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
2 participants