-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Comments
…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.
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. |
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. |
…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.
…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.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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, thecdkDrag
element you dragged won't go back to the original list. Here's a gif that showcases this behavior: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 thedonelist
'scdkDrop
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.)The text was updated successfully, but these errors were encountered: