Skip to content

OnNavigating wrong target when tapping the same tab #25599

@lszl84

Description

@lszl84

Description

Let's say we have a tab bar with MainPage and SettingsPage. We are on MainPage and pushed DetailsPage on the navigation stack. We tap the MainPage tab again and we're back to MainPage from DetailsPage.

This is ok, but the problem is we don't get any indication of that in the AppShell's OnNavigating event, so we cannot prevent this with e.Cancel (e.g. when the user has some unsaved changes on the DetailsPage or something):

2024-10-30 12:44:17.996224+0100 BeginnersTask[50334:1782255] --- Navigating from //MainPage/DetailPage to //MainPage/DetailPage
2024-10-30 12:44:18.559204+0100 BeginnersTask[50334:1782255] --- Navigated from //MainPage/DetailPage to //MainPage

The Current and Target properties are the same in OnNavigating, but in OnNavigated the Previous and Current are different.

Code: TabBarNavigation from this repo: https://github.com/lszl84/maui-scroll-bug.git

Steps to Reproduce

  1. Tap Home
  2. Add a task
  3. Tap on the task - the details open
  4. Tap Home again - we are back home, but no indication of that in the OnNavigating event of the AppShell.

Link to public reproduction project repository

https://github.com/lszl84/maui-scroll-bug.git

Version with bug

8.0.82 SR8.2

Is this a regression from previous behavior?

Not sure, did not test other versions

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

No response

Metadata

Metadata

Labels

area-navigationNavigationPagepartner/syncfusionIssues / PR's with Syncfusion collaborationplatform/ioss/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions