popover
popover copied to clipboard
With latest dependencies, the :enter animation only plays the first time the popover is opened
Here's a demo Stackblitz that illustrates the problem.
I just:
- forked the issue template
-
updated all dependencies (except
core-js
for that reason).
NB: Actually, the opening animation does play again if you re-trigger an opening while the closing animation is playing.
I don't quite know what's broken and will keep investigating a bit tonight 🙂
Looks like the culprit is @angular/cdk
and that the breaking change was introduced between 10.1.1
and 10.1.2
.
I updated the project to 7.0.0 to use angular 11, then updated the stackblitz pages here and here. Please lmk if you see anything off. Thanks!
still broken, please reopen
I've been spinning my wheels for a few hours w/ this. @ccjmne do you have any idea how this can be fixed?
I was thinking possibly some combination of tweaking popover.animations.ts
or _onAnimationDone()
.
When I change to this:
<ng-template>
<div
class="sat-popover-container"
#focusTrapElement
[ngClass]="_classList"
[@transformPopover]="_getAnimation()"
(@transformPopover.start)="_onAnimationDone($event)"
(@transformPopover.done)="_onAnimationDone($event)"
>
<ng-content></ng-content>
</div>
</ng-template>
I can see the good animations occur when this order happens:
- start: void -> visible
- end: void -> visible
- start: visible -> void
- start: void -> visible
- end: visible -> void
- end: void -> visible
but the failed actions occur when they are in the more standard order of:
- start: void -> visible
- end: void -> visible
- start: visible -> void
- end: visible -> void
- start: void -> visible
- end: void -> visible
Perhaps something is not being cleared appropriately?
Shouldn't this be reported upstream to material/cdk? Doesn't really seem related to popover. At least from what I tried.
@fxck Agreed. I'm glad someone else verified that this is likely outside of the scope of this project. Thank you.
Any solution ?
I am checking into PR #220 now that hopefully will fix the issue