Animations not working on iOS 12 / 13: animate is undefined
See original GitHub issueWhich @angular/* package(s) are the source of the bug?
animations
Is this a regression?
Yes
Description
I have found a regression in Angular animations v13.2.2 for users using iOS v13 and older versions. Please find the stack trace attached.
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Error: D.animate is not a function. (In 'D.animate(P,Y)', 'D.animate' is undefined)
_triggerWebAnimation@...:1:1039926
_buildPlayer@...:1:1039652
play@...:1:1040066
play@...:1:1034903
...:1:1031449
forEach@[native code]
_flushAnimations@...:1:1031324
flush@...:1:1026173
flush@...:1:1037791
...:1:1045273
run@...:1:11157
end@...:1:1045224
$_@...:1:810666
Zl@...:1:817366
$d@...:1:817386
detectChanges@...:1:855490
tick@...:1:885371
Please provide the environment you discovered this bug in (run ng version
)
Angular CLI: 13.2.2
Node: 16.13.0
Package Manager: npm 8.1.0
OS: win32 x64
Angular: 13.2.1
... animations, cdk, common, compiler, compiler-cli, core, forms
... localize, material, platform-browser
... platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1302.2
@angular-devkit/build-angular 13.2.2
@angular-devkit/core 13.2.2
@angular-devkit/schematics 13.2.2
@angular/cli 13.2.2
@angular/fire 7.2.0
@schematics/angular 13.2.2
rxjs 7.5.2
typescript 4.5.5
Anything else?
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:14 (1 by maintainers)
Top Results From Across the Web
"TypeError: element['animate'] is not a function" error on ios ...
My device is running on v13. The element animate api is only available for versions higher than v13.1.For Versions below you can use...
Read more >CSS Animations Not Working? Try These Fixes - HubSpot Blog
Learn how to fix common CSS animation error and get your animations looking how you want them.
Read more >lottie-web - npm
Lottie is a mobile library for Web, and iOS that parses Adobe After Effects animations exported as json with Bodymovin and renders them ......
Read more >Animate messages on iPhone - Apple Support
In the Messages app , you can animate a single message with a bubble effect or fill the entire message screen with a...
Read more >Animations - iOS Design Handbook
Rotate. By changing the angle of the element, you can create interesting effects like the loading animation in iOS, or the Add icon...
Read more >Top Related Medium Post
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I observed that only a couple of our users are still using Safari < 14, which are the users with an iPhone 6 as they are stuck with iOS 12. So I first decided to not increase the bundle size, but only load web-animations polyfill for those users:
angular.json:
ployfills.ts:
This worked fine. But after all I chose another approach by reverting the steps above and disable animations for those people with iPhone6/old Safari, because they have a hard time anyway and lagging animations don’t add to a good user experience:
app.module.ts
To fix this issue, I’m using this snippet at
polyfills.ts
: