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 Animations and ngx-masonry #55

Open
verfault opened this issue Aug 20, 2020 · 2 comments
Open

Angular Animations and ngx-masonry #55

verfault opened this issue Aug 20, 2020 · 2 comments

Comments

@verfault
Copy link

verfault commented Aug 20, 2020

Hello.
I'm using some animations from Angular's platform-browser/animations package.

The problem is that ngx-masonry removes an element from DOM on ngOnDestroy hook by default.
Reasons for that are obvious of course.

But in that case i can't use any animations on leave because Angular removes HTMLElements after animation's (*.done) hook and that makes a strange effect when masonry grid is disappearing directly five seconds before than the main component does.

Also here is no any option in the config to prevent destroying right after ngOnDestroy.

I mean:

ngOnDestroy() {
if (this.images && this.images.size === 0 && this.element.nativeElement.parentNode) {
this.playAnimation(false);
this.parent.remove(this.element.nativeElement);
}
}

@wynfred
Copy link
Owner

wynfred commented Sep 17, 2020

Hi, thank you for reporting the issue. Unfortunately, I didn't find a way to resolve this, but I believe you can work around this by adding the animation to the component itself. Feel free to let me know if you have any idea about solving this problem.

@wynfred
Copy link
Owner

wynfred commented Sep 17, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants