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

cdk-drop-list-dragging not removed when exiting drop area #15233

Closed
kyashan opened this issue Feb 19, 2019 · 5 comments · Fixed by #15266
Closed

cdk-drop-list-dragging not removed when exiting drop area #15233

kyashan opened this issue Feb 19, 2019 · 5 comments · Fixed by #15266
Assignees
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@kyashan
Copy link

kyashan commented Feb 19, 2019

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Cdk-drop-list-dragging class should be removed when the pointer leaves the target container area.
When the dragged element is dropped outside a target container after passing over it should return the source container as result

What is the current behavior?

I'm implementing a drag & drop from one container to multiple drop areas: when entering these areas I want to highlight these areas by using cdk-drop-list-dragging class, but once exiting one area, the class is not removed. Also, I've noticed that dropping an element outiside a drop area, the element gets assigned to last visited drop area, even if pointer is not there anymore.

What are the steps to reproduce?

Alt Text

What is the use-case or motivation for changing an existing behavior?

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

"@angular/animations": "^7.2.4",
"@angular/cdk": "^7.3.2",
"@angular/common": "^7.2.4",
"@angular/compiler": "^7.2.4",
"@angular/compiler-cli": "^7.2.4",
"@angular/core": "^7.2.4",
"@angular/fire": "^5.1.1",
"@angular/forms": "^7.2.4",
"@angular/http": "^7.2.4",
"@angular/material": "^7.3.2",
"@angular/platform-browser": "^7.2.4",
"@angular/platform-browser-dynamic": "^7.2.4",
"@angular/platform-server": "^7.2.4",

Is there anything else we should know?

@kyashan kyashan changed the title cdk-drop-list-dragging not removing when exiting drop area cdk-drop-list-dragging not removed when exiting drop area Feb 19, 2019
@crisbeto crisbeto self-assigned this Feb 19, 2019
@crisbeto
Copy link
Member

I wasn't able to reproduce the issue here. Note that the item is still considered part of a drop list until it gets dragged into a different list.

@volser
Copy link

volser commented Feb 21, 2019

I'm getting error all time here
http://recordit.co/3j2iS4IJ6I

Error in /turbo_modules/@angular/[email protected]/bundles/cdk-drag-drop.umd.js (1829:54)
Cannot read property 'clientRect' of undefined

@volser
Copy link

volser commented Feb 21, 2019

@crisbeto https://stackblitz.com/edit/angular-8jcl5s-ycs362

@volser
Copy link

volser commented Feb 21, 2019

d&d is not working very well with changeDetection: ChangeDetectionStrategy.OnPush (

@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent has pr labels Feb 21, 2019
crisbeto added a commit to crisbeto/material2 that referenced this issue Feb 21, 2019
…ent with OnPush

Fixes the dragged styling not being removed from a drop container, which is wrapped inside a component with `OnPush` change detection, when an item is dragged into a connected container.

Fixes angular#15233.
crisbeto added a commit to crisbeto/material2 that referenced this issue Feb 21, 2019
…ent with OnPush

Fixes the dragged styling not being removed from a drop container, which is wrapped inside a component with `OnPush` change detection, when an item is dragged into a connected container.

Fixes angular#15233.
crisbeto added a commit to crisbeto/material2 that referenced this issue Feb 24, 2019
…ent with OnPush

Fixes the dragged styling not being removed from a drop container, which is wrapped inside a component with `OnPush` change detection, when an item is dragged into a connected container.

Fixes angular#15233.
crisbeto added a commit to crisbeto/material2 that referenced this issue Mar 8, 2019
…ent with OnPush

Fixes the dragged styling not being removed from a drop container, which is wrapped inside a component with `OnPush` change detection, when an item is dragged into a connected container.

Fixes angular#15233.
andrewseguin pushed a commit that referenced this issue Mar 20, 2019
…ent with OnPush (#15266)

Fixes the dragged styling not being removed from a drop container, which is wrapped inside a component with `OnPush` change detection, when an item is dragged into a connected container.

Fixes #15233.
@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 10, 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
3 participants