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

[cdkDrag] cdkDragEnded should be fired before transition animation #14498

Closed
kusmi opened this issue Dec 13, 2018 · 1 comment · Fixed by #14513
Closed

[cdkDrag] cdkDragEnded should be fired before transition animation #14498

kusmi opened this issue Dec 13, 2018 · 1 comment · Fixed by #14513
Assignees
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix P4 A relatively minor issue that is not relevant to core functions

Comments

@kusmi
Copy link

kusmi commented Dec 13, 2018

The cdkDragEnded fires after the animation (which makes sense in the literal case - because then the drag has actually ended), but if you want to interfere with the drag animation, there is no hook to do that.

E.g. if you want to customize the drag transition-animation depending on mouse location.

I would propose to either call the cdkDragEnded as soon as the mouse is released (just before the animation) - or add another hook like "cdkDragWillEnd". (Similar as in iOS development, where you get a callback before and after the animation).

@crisbeto crisbeto self-assigned this Dec 13, 2018
@crisbeto crisbeto added feature This issue represents a new feature or feature request rather than a bug or bug fix has pr P4 A relatively minor issue that is not relevant to core functions labels Dec 14, 2018
crisbeto added a commit to crisbeto/material2 that referenced this issue Dec 14, 2018
Adds the `cdkDragReleased` event, in addition to `cdkDragEnded`. The difference between released and ended is that released will fire as soon as the user has released the item, whereas ended will fire once all animations are done. The former is useful to customize the animation on drop, based on where the item is being dropped.

Fixes angular#14498.
crisbeto added a commit to crisbeto/material2 that referenced this issue Dec 14, 2018
Adds the `cdkDragReleased` event, in addition to `cdkDragEnded`. The difference between released and ended is that released will fire as soon as the user has released the item, whereas ended will fire once all animations are done. The former is useful to customize the animation on drop, based on where the item is being dropped.

Fixes angular#14498.
crisbeto added a commit to crisbeto/material2 that referenced this issue Dec 14, 2018
Adds the `cdkDragReleased` event, in addition to `cdkDragEnded`. The difference between released and ended is that released will fire as soon as the user has released the item, whereas ended will fire once all animations are done. The former is useful to customize the animation on drop, based on where the item is being dropped.

Fixes angular#14498.
jelbourn pushed a commit that referenced this issue Dec 18, 2018
Adds the `cdkDragReleased` event, in addition to `cdkDragEnded`. The difference between released and ended is that released will fire as soon as the user has released the item, whereas ended will fire once all animations are done. The former is useful to customize the animation on drop, based on where the item is being dropped.

Fixes #14498.
josephperrott pushed a commit to josephperrott/components that referenced this issue Jan 14, 2019
Adds the `cdkDragReleased` event, in addition to `cdkDragEnded`. The difference between released and ended is that released will fire as soon as the user has released the item, whereas ended will fire once all animations are done. The former is useful to customize the animation on drop, based on where the item is being dropped.

Fixes angular#14498.
@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
feature This issue represents a new feature or feature request rather than a bug or bug fix P4 A relatively minor issue that is not relevant to core functions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants