Skip to content

Animations: end state style does not persist after animation ends (iOS Safari) #16919

Closed

Description

@dharders

I'm submitting a ... (check one with "x")

[x] bug report

Current behavior

After an animation completes, with a state style defined, the target state style does not persist after animating correctly to the specified style (on iOS Safari).

Expected behavior

Expect to the state style to persist after animation completes.

Minimal reproduction of the problem with instructions

https://plnkr.co/edit/P6mr4H?p=preview

Note: You need to test this on iOS Safari to see the bug, as it works as expected on Chrome Desktop. (I tested with iOS 10.2.1)

Click the top div, the color should stay RED. (Bottom div is a separate animation bug repro, #16918 )

What is the motivation / use case for changing the behavior?

Correct animations and styling

Please tell us about your environment:

Windows, Code, Yarn, ng-cli

  • Angular version: 4.2.0-rc.0
  • Browser: iOS 10.2.1 Safari and WKWebView
  • Language: TypeScript 2.3.2

  • Node (for AoT issues): node --version =

Activity

  1. matsko commented on May 22, 2017

    @matsko
    Contributor

    Yes I se the issue here. Thank you for reporting this. I'll investigate.

  2. self-assigned this
    on May 22, 2017
  3. added
    area: animations
    regression
    on May 22, 2017
  4. matsko commented on May 22, 2017

    @matsko
    Contributor

    Note that this does in-fact appear for desktop on Safari.

  5. added a commit that references this issue on May 22, 2017
    e7d9fd8
  6. dharders commented on May 23, 2017

    @dharders
    Author

    @matsko Just tested latest build and found it fixed the two cases I provided. Thanks for the quick turnaround!

    However, I have found another case where the animation end styles are now too persistent. i.e. they stay even after setting a new state.

    Repro: https://plnkr.co/edit/fWaBeI?p=preview (uses master builds)

    I expect the opacity to be 1 after the animation finishes. i.e. the 'normal' state

    PS I can open a new issue if you want, but figured it was related to this issue

  7. dharders commented on May 23, 2017

    @dharders
    Author

    Actually, the group() end styles are overriding the last animate(style()) in the plunker above. i.e. it is ignoring the order

    trigger('transAnim', [
       state('normal', style({ transform: 'translate3d(0px, 0px,0)', opacity: '1' })),
       state('intrans', style({ transform: 'translate3d(90px, 0px,0)', opacity: '0' })),
       transition('normal => intrans',
         [
           style({ opacity: '1' }),
           group([
             animate('1000ms 200ms', keyframes([
               style({ transform: 'translate3d(0px, 0px,0)', offset: 0.25 }),
               style({ color: '#ffffff', offset: 0.7 }),
               style({ transform: 'translate3d(90px, 0px,0)', offset: 1 }),
             ])),
             animate('500ms 1100ms ease-in-out', style({ opacity: '0', backgroundColor: 'rgba(0, 191, 255, 0.5)' }))
           ]),
           style({ transform: 'translate3d(0px, 0px,0)' }),
           animate('500ms 50ms ease-in-out', style({ opacity: '1' })),
         ])
     ])

    Also, I seem to be changing the state back to 'normal' before the 'intrans' animation is complete. I'd expect it to still apply the 'normal' styles.

    /cc @matsko

  8. dharders commented on May 23, 2017

    @dharders
    Author

    You can set the ng version in systemjs.config.js back to 4.2.0-beta.1 to see the desired behaviour.

    Don't forget to set ngNightly = false;

    var ngVer = '4.2.0-beta.1';
    var ngNightly = false;         // set false to use ngVer
    
  9. matsko commented on May 23, 2017

    @matsko
    Contributor

    @dharders thank you for reporting the new bug. Please do make an issue for this and I'll hop onto it first thing tomorrow.

  10. dharders commented on May 23, 2017

    @dharders
    Author

    New issue created #16947

  11. added a commit that references this issue on Aug 11, 2017
    44cbf06
  12. added a commit that references this issue on Aug 28, 2017
    43411bd
  13. angular-automatic-lock-bot commented on Sep 11, 2019

    @angular-automatic-lock-bot

    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.

  14. locked and limited conversation to collaborators on Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: animationsregressiontype: bug/fix

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions