popover icon indicating copy to clipboard operation
popover copied to clipboard

With latest dependencies, the :enter animation only plays the first time the popover is opened

Open ccjmne opened this issue 4 years ago • 9 comments

Here's a demo Stackblitz that illustrates the problem.

I just:

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 🙂

ccjmne avatar Aug 12 '20 18:08 ccjmne

Looks like the culprit is @angular/cdk and that the breaking change was introduced between 10.1.1 and 10.1.2.

ccjmne avatar Aug 12 '20 21:08 ccjmne

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!

isaackehle avatar Nov 23 '20 18:11 isaackehle

still broken, please reopen

jotatoledo avatar Nov 23 '20 19:11 jotatoledo

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?

isaackehle avatar Nov 23 '20 23:11 isaackehle

Shouldn't this be reported upstream to material/cdk? Doesn't really seem related to popover. At least from what I tried.

fxck avatar Jan 19 '21 09:01 fxck

@fxck Agreed. I'm glad someone else verified that this is likely outside of the scope of this project. Thank you.

isaackehle avatar Jan 20 '21 04:01 isaackehle

Any solution ?

flavianoredressa avatar Jul 26 '21 22:07 flavianoredressa

I am checking into PR #220 now that hopefully will fix the issue

isaackehle avatar Jul 27 '21 20:07 isaackehle