bug(ion-header): applying box-shadow leads to laggy back navigation animation
See original GitHub issuePrerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
- v4.x
- v5.x
- v6.x
Current Behavior
if the box-shadow
is added to ion-header,
the back navigation is laggy. The same behavior applies when box-shadow
is applied to ion-toolbar.
Expected Behavior
there should be no lag if you navigate back using box-shadow.
Steps to Reproduce
apply global styling for ion-header
inside global.scss
:
ion-header {
box-shadow: 0 0 10px 0 rgba(var(--ion-color-dark-rgb), 0.4);
}
Now just navigate back and forward.
The current “workaround” is to use instead of box-shadow
, the filter
property:
ion-header {
filter: drop-shadow(0 0 10px rgba(var(--ion-color-dark-rgb), 0.4));
}
Here i’m not sure about compatibility and performance issues, so i would prefer to use box-shadow
.
Code Reproduction URL
No response
Ionic Info
Ionic:
Ionic CLI : 5.4.16
Utility:
cordova-res : not installed native-run : not installed
System:
NodeJS : v16.14.2 npm : 8.5.0 OS : macOS Monterey
Additional Information
No response
Issue Analytics
- State:
- Created a year ago
- Comments:11 (9 by maintainers)
Top Results From Across the Web
Slow back animation on iOS Simulator and device - Ionic Forum
My problem is that the back animation on iOS Devices is very slow. I have no problem on the browser with the web-app....
Read more >Stop animating box-shadows the wrong way! - YouTube
You can animate and transition just about anything with CSS, but that doesn't mean that it's a good idea to do it.
Read more >How to animate box-shadow with silky smooth performance
Animating a change of box-shadow will hurt performance. There's an easy way of mimicking the same effect, however, with minimal re-paints, that ...
Read more >The Push Notifications Guide for Ionic & Capacitor
In this tutorial we will integrate Push Notifications using Firebase, since Firebase is basically required for Android anyway and you can easily use...
Read more >How to Build an Ionic 5 Calendar with Modal & Customisation
Navigate to Functions and follow the instructions. Firebase Tools Express is a web application framework, that provides restful endpoints.
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
Thanks! I can reproduce the described behavior, but this is not a bug in Ionic.
The iOS page transition animates the elements inside of the toolbar, but not the toolbar or header elements themselves: https://github.com/ionic-team/ionic-framework/blob/main/core/src/utils/transition/ios.transition.ts#L527-L577
You need to apply the box shadow to
ion-header .header-background
instead for this to work as expected.Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.