bug(angular): the leaving page is painted fully visible for one frame at the end of a back transition — its animation is destroyed one requestAnimationFrame before the stack controller hides it · Issue #31599 · ionic-team/ionic-framework · GitHub
Skip to content

bug(angular): the leaving page is painted fully visible for one frame at the end of a back transition — its animation is destroyed one requestAnimationFrame before the stack controller hides it #31599

Open

Description

@tzdevelopteam

Ionic Framework Version

v9.x (@ionic/core 9.0.7, @ionic/angular 9.0.7)

Current Behavior

On a back navigation the leaving page sits above the entering one (core/src/utils/transition/index.ts L286–295, setZIndex: leaving z-index: 101, entering 100) and animates out (opacity / transform). When the animation finishes:

  1. transition() (utils/transition/index.ts L29–45) calls result.animation.destroy() — cleanUpElements() (utils/animation/animation.ts L191–199) cancels the Web Animations, which drops their fill: both end state; the leaving page snaps back to opacity 1 / transform none while still on top;
  2. then afterTransition() and the promise resolves;
  3. @ionic/angular's StackController.setActive continues .then(() => cleanupAsync(...)) (dist/common/directives/navigation/stack-controller.js L113–114), and cleanupAsync (L245–255) waits for a requestAnimationFrame before cleanup destroys the popped view / adds ion-page-hidden (L258–280).

Between 1 and 3 there is at least one rendered frame in which the page the user just left is painted in full on top of the page they navigated back to.

Expected Behavior

The leaving page is hidden or removed before its exit animation's end state is dropped, so the back navigation ends on the entering page without a flash.

Steps to Reproduce

  1. Angular app, two routed pages A → B, B has a back button.
  2. Navigate forward to B, then back. Record the screen (or hook requestAnimationFrame and sample getComputedStyle(leavingEl).opacity once the transition promise resolves).
  3. After the exit animation reaches opacity 0, the leaving element is at opacity 1 for one frame before it is detached.

Ionic Info

@ionic/core 9.0.7, @ionic/angular 9.0.7, Angular 22.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions