Fix for unable to select a tab after backing out of a page and returning.
Root cause
When navigating back to the main page, the SelectedItem restores its old value instead of clearing it. As a result, when updating with the MapCurrentPage, it does not get updated properly.
Description of Issue Fix
The fix involves setting the SelectedItem property of the NavigationView to null in the disconnect handler, mapping the IsSelected property of the CurrentPage, and setting IsSelected in the MapItemSource to resolve the background-related issue.
Tested the behavior in the following platforms.
- [x] Windows
- [x] Android
- [x] iOS
- [x] Mac
Issues Fixed
Fixes https://github.com/dotnet/maui/issues/24741
Output
| Before Issue Fix | After Issue Fix |
|---|---|
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
Add UI Test please
@PureWeen, Unfortunately, I'm unable to include a test case for the fix, as it's not possible to add an automation ID for the tab title.
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
Added UITest.
/azp-run
Added UITest.
@jsuarezruiz, Thank you for your effort in adding and committing the test case for this complex scenario.
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/rebase
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/rebase
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/rebase
/rebase
/azp run
