Animation on page transition on iOS is broken
See original GitHub issueBug Report
Ionic version:
[x] 4.x
Current behavior: Page transition is breaking on iOS. Android is working good.
Expected behavior: Transition smooth onto next page.
Steps to reproduce:
Related code:
Typically I’d use this.navCtrl.navigateForward(['route', id]);
to navigate to the next page, but 90% of time the animation would stop.
Other information:
Ionic info:
Ionic:
ionic (Ionic CLI) : 4.10.3 (/Users/andjelicnikola/.nvm/versions/node/v10.7.0/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.0.2
@angular-devkit/build-angular : 0.11.4
@angular-devkit/schematics : 7.2.2
@angular/cli : 7.2.2
@ionic/angular-toolkit : 1.2.1
Cordova:
cordova (Cordova CLI) : 7.1.0
Cordova Platforms : android 7.1.0, ios 4.4.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 23 other plugins)
System:
ios-deploy : 2.0.0
NodeJS : v10.7.0 (/Users/andjelicnikola/.nvm/versions/node/v10.7.0/bin/node)
npm : 6.8.0
OS : macOS Mojave
Xcode : Xcode 10.1 Build version 10B61
Issue Analytics
- State:
- Created 5 years ago
- Reactions:10
- Comments:83 (30 by maintainers)
Top Results From Across the Web
Has the behavior of asymmetric transitions changed in SwiftUI ...
Run the above on a iOS 16 simulator. Swipe a couple of pages and then change direction. Notice that the transition of the...
Read more >ios - Transition animation not working in iOS16 but was ...
In iOS 16, there appears to be a problem with @AppStorage vars and animation. Here is one possible workaround. Use @State var for...
Read more >Animation breaks on iOS Safari; works on Chrome and Firefox
Hi everyone, The issue here seems to be with the shifting of the background images on slide in / out. In the functions...
Read more >IOS Page turn animation not working
Disabling animation results in the standard page transition. I have tried enabling and disabling animation, restarting the app, restarting the phone and ...
Read more >PSA: iOS 15 mobile CSS transitions are broken
Just a quick note to save your sanity if, like me, you were trying to debug why some of your CSS transition animations...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
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
My current guess is the performance issue you were seeing is actually related to this bug in WebKit: https://bugs.webkit.org/show_bug.cgi?id=201048
Animations in the Shadow DOM tend to freeze/be janky when the layout is invalidated. In this case
Node.insertBefore
causes the issue. Unfortunately, Angular can sometimes call that when evaluating an ngIf, so the issue is easier to dig up in Angular apps.I am discussing with the team as to whether there may be an appropriate workaround we could go with for now.
This is happening because you are assigning subscription variables and/or subscribing in ngOnInit(). I was able to overcome this issue by using ionViewDidEnter() instead of ngOnInit(). However, when you do this, the page looks empty at first. If you don’t want that, you can use ghost elements to fill out the page and then when your API comes through, just display the correct items.
Addition: I didn’t know ionic already has something similar to ghost elements. Please see https://ionicframework.com/docs/api/skeleton-text
If anybody wants to reproduce the problem, just assign an API subscription to a value in ngOnInit() then subscribe it in the ion-content ngIf with async.
In my case, it was:
TS:
HTML:
FIX (replace ngOnInit() with ionViewDidEnter()):
It would be great if this was fixed asap.