[Bug] [iOS] Navigating to a ModalPage under another tab than selected won't change selected tab #15608
Description
Description
Navigating to a ModalPage under another tab than selected, leaves us on the page where we were before invoking Shell.Current.GoToAsync (see attached video and steps to reproduce for more details).
NavigateToModalPageOnAnotherTab.mov
Steps to Reproduce
- Download attached project NavigationIssue.zip or clone it from GitHub https://github.com/MaxFmi/NavigatingToASubPageUnderAnotherTabThanSelected
- Unzip and open it in your IDE
- Start Application on iOS
- Select the third tab
- Click on the Button "GoTo RegularPage"
- Select second tab
- Click on the Button "GoTo ModalPage under TabItem 3"
Expected Behavior
- The target ModalPage shows up but gets removed right away.
- When we afterwards select the third tab, we see the ModalPage that we wanted navigate to.
Actual Behavior
Third tab should be the selected one and we should see and stay on the ModalPage.
Basic Information
- Version with issue: 5.0.0.2478
- Last known good version: -
- Platform Target Frameworks:
- iOS: 15.5
- Affected Devices: iOS
Reproduction Link
Workaround
Having a separate GoToAsync call that pre-selects the target tab
// A separate navigation call to select the target tab.
// await Shell.Current.GoToAsync("//TabBar/Tab.Item3/");
// When we only have this invocation, the target tab will not be selected.
await Shell.Current.GoToAsync("//TabBar/Tab.Item3/ModalPage", false);
When we don't use the false parameter for the animation in the second call we will see how the NavigationStack is cleared for the target Tab (see video below).
https://user-images.githubusercontent.com/61872738/202434681-c4039139-2b5b-494e-8e8b-d4477d53bc42.mov