-
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
bug:(@angular/cdk/drag-drop): inconsistent transfer between cdk-drop #12944
Comments
Check Netanel Basal's article, there is an example on how to connect 2 drop zones. |
…n drop Currently when an item is dropped, we return it to its initial position in the DOM so Angular can take over and re-render it if necessary, however this breaks down if the item is the only child of the drop container and we weren't able to grab a reference element that we can use to restore its position. These changes address the issue by using the initial drop container as a reference. Fixes angular#12944.
@AhsanAyaz a note on your example: the CDK won't move the item from one container to another for you, that's up to you to do in the |
Thanks @crisbeto for the fix and PR. 👍 |
…n drop Currently when an item is dropped, we return it to its initial position in the DOM so Angular can take over and re-render it if necessary, however this breaks down if the item is the only child of the drop container and we weren't able to grab a reference element that we can use to restore its position. These changes address the issue by using the initial drop container as a reference. Fixes #12944.
…n drop (#12948) Currently when an item is dropped, we return it to its initial position in the DOM so Angular can take over and re-render it if necessary, however this breaks down if the item is the only child of the drop container and we weren't able to grab a reference element that we can use to restore its position. These changes address the issue by using the initial drop container as a reference. Fixes #12944.
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
What is the expected behavior?
The dragged item should be transferrable between connected drop-zones (
cdk-drop
) but they have some inconsitent behavior. I've shared a stackblitz link below. When you open it:Drag Me 1
div can be transferred toZone2
but then cannot be transferred back to Zone1.Drag Me 2
can be dragged toZone1
and a preview is shown, but cannot be dropped actually.What is the current behavior?
The item is transferred from zone1 to zone2 but I can not transfer it back to zone1 although they are connected zones. Please correct me if this isn't an appropriate use case :)
What are the steps to reproduce?
StackBlitz: https://stackblitz.com/edit/cdk-drag-drop-issue
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
@angular/[email protected]
Image
The text was updated successfully, but these errors were encountered: