Skip to content

[iOS] Popping a page includes an unexpected page in the NavigationStack when the underlying page's OnAppearing method is called #28414

@MitchBomcanhao

Description

@MitchBomcanhao

Description

I've tested this on iOS, Android and Windows.
on iOS only, the NavigationStack still contains the page you've just popped in the navigation stack when the underlying page's OnAppearing method is triggered. this is causing failures in our existing code as this used to work fine on xamarin forms. I've tried this back to dotnet maui 9.0.0 and it still fails in the same way.

Steps to Reproduce

Prerequisites

  1. create a basic app with 3 pages (FirstPage, SecondPage, ThirdPage), not using shell. set the main page as a NavigationPage with FirstPage.
  2. on FirstPage add a button to navigate to SecondPage
  3. on SecondPage add a button to navigate to ThirdPage
  4. on SecondPage add an override to OnAppearing, where you can check the navigation stack.

Repro steps:

  1. Launch the app
  2. tap the button to navigate to SecondPage
  3. tap the button to navigate to ThirdPage
  4. tap the back button on the top left of the screen, to take you back to SecondPage
  5. OBSERVE
  • on iOS: the NavigationStack will have 3 pages, with the last one being ThirdPage when inspected inside the OnAppearing method of the SecondPage. it should only have 2 pages.
  • on Android and Windows: NavigationStack only has 2 pages, with the last one being SecondPage, as expected

iOS:

Image

Android

Image

Windows

Image

Link to public reproduction project repository

https://github.com/MitchBomcanhao/maui28414

Version with bug

9.0.50 SR5

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-navigationNavigationPagepartner/syncfusionIssues / PR's with Syncfusion collaborationplatform/ioss/needs-attentionIssue has more information and needs another looks/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions