Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(header): prevent flickering during iOS page transitions#30705

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
thetaPC wants to merge3 commits intomain
base:main
Choose a base branch
Loading
fromFW-6765

Conversation

thetaPC
Copy link
Contributor

@thetaPCthetaPC commentedOct 3, 2025
edited
Loading

Issue number:resolves#25326


What is the current behavior?

The header flickers upon page transition when on iOS mode and using a condensed header:

Entering Page Two (P1 → P2):
When navigating to Page Two, which has a collapsing header (intended to be hidden until scroll), the header briefly flashes into view. This happens because the header is initially rendered with fullopacity: 1 before the component's logic can applyopacity: 0 to hide it, causing a visible flicker.

Navigating Back (P2 → P1):
When navigating back, Page One's header briefly bleeds through the top of Page Two. Although Page Two is on top (z−index: 100), its collapsing header is set toopacity: 0. This transparency allows Page One header (z−index: 99) to become visible underneath, as the transparent area cannot block the content below it.

The header flickers upon page transition when on iOS mode and using a fade header:

Entering Page Two (P1 → P2):
When navigating to Page Two, which has a fade header (should not have a background on load), the header background briefly flashes into view. This happens because the header is initially rendered with fullopacity: 1 before the component's logic can applyopacity: 0 to hide it, causing a visible flicker.

What is the new behavior?

  • Added a transition-specific class that is applied to the condensed ion-header element to override its default transparency.

This guarantees the header to act as an opaque block during the page transition, eliminating visual flickering caused by earlyopacity: 0 or the header underneath bleeding through.

  • Added a transition-specific class that is applied to the fade ion-header element to override its default opaque background.

This guarantees the header to act as a transparent block during the page transition, eliminating visual flickering caused by defaultopacity: 1.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Dev build:8.7.6-dev.11759524961.1cff6814

@vercelVercel
Copy link

vercelbot commentedOct 3, 2025
edited
Loading

The latest updates on your projects. Learn more aboutVercel for GitHub.

ProjectDeploymentPreviewCommentsUpdated (UTC)
ionic-frameworkReadyReadyPreviewCommentOct 6, 2025 4:25pm

@github-actionsgithub-actionsbot added the package: core@ionic/core package labelOct 3, 2025
* Large title toolbar should just use the content background
* since it needs to blend in with the header above it.
*/
.header-collapse-condenseion-toolbar,
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This is the large title that is tied to the inactive header.

Comment on lines +98 to +105
.header-collapse-condenseion-toolbar,
/**
* Override styles applied during the page transition to prevent
* header flickering.
*/
.header-collapse-condense-inactive.header-transitioning:not(.header-collapse-condense)ion-toolbar {
--background:var(--ion-background-color,#fff);
}
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I grouped these together so they will always be the same background color since they are related to the condensed header.

(result)=>{
if(result.animation){
result.animation.destroy();
consttransitioningInactiveHeader=getIosIonHeader(opts);
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm grabbing the header here so we don't have to do query it twice withinbeforeTransition and in thefinally.

)
.finally(()=>{
// Ensure that the header is restored to its original state.
setHeaderTransitionClass(transitioningInactiveHeader,false);
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Removed the class here since it should be removed regardless of the success ofrunTransition.

return;
}

consttransitionClass='header-transitioning';
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm open to a different name. I'm not too happy with it but not sure what else to call it to be specific.

Comment on lines +354 to +356
if(mode!=='ios'){
returnnull;
}
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I didn't see the benefit of querying out the header if the mode ismd. However, we would have to update this innext to usetheme instead ofmode.

@thetaPCthetaPC changed the titlefix(header): prevent flickering upon page transition on iOSfix(header): prevent flickering during iOS page transitionsOct 3, 2025
@thetaPCthetaPC marked this pull request as ready for reviewOctober 3, 2025 20:13
@thetaPCthetaPC requested a review froma team as acode ownerOctober 3, 2025 20:13
@thetaPCthetaPC requested a review fromShaneKOctober 3, 2025 20:13
)
.finally(()=>{
// Ensure that the header is restored to its original state.
setHeaderTransitionClass(transitioningInactiveHeader,false);
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Removed class at the end so the header can go back to its default, preventing any potential regressions.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ShaneKShaneKAwaiting requested review from ShaneKShaneK is a code owner automatically assigned from ionic-team/framework

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
package: core@ionic/core package
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

bug: ios transition does not account for fade header
1 participant
@thetaPC

[8]ページ先頭

©2009-2025 Movatter.jp