question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug(ion-header): applying box-shadow leads to laggy back navigation animation

See original GitHub issue

Prerequisites

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.

https://user-images.githubusercontent.com/26873275/163140132-36d76ba9-e1f3-423c-ab23-c7b311122670.mov

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:closed
  • Created a year ago
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
liamdebeasicommented, Apr 13, 2022

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.

0reactions
ionitron-bot[bot]commented, May 14, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found