Fix Shell Flyout Menu Visibility Issue When Navigating Between TabBar and Flyout Items
Issue:
In the sample, if there are both flyout items and tab bar items in the Shell, navigating to a TabBar item causes the flyout menu icon to disappear. However, when navigating back to a flyout item, the flyout menu is not visible.
Root Cause:
When navigating to a TabBar item, the flyout behavior is set to Disabled. Upon returning to a flyout item, the flyout behavior is not restored. This issue was previously working fine but regressed due to PR-23863. In that PR, navigating using services clears the previous sections content cache, so when navigating back to the flyout page, the page is unavailable, preventing the flyout behavior from being reset.
Fix:
When updating the flyout behavior, the visible page check is not required. Instead, it's necessary to verify whether the parent is a Shell section. Therefore, I replaced the check for the visible page with a check to ensure the CurrentItem is a ShellSectionController.
Fixes #25436
Hey there @vishnumenon2684! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.
/backport to main
Started backporting to main: https://github.com/dotnet/maui/actions/runs/11504316344
The FlyoutBehavior value takes into account if the FlyoutBehavior is set on the Page itself which I think might cause this to miscalculate if the user has set FlyoutBehavior on the realized ContentPage
@PureWeen, based on the suggestion I'm looking for an alternate fix.
rebase this for main please
Hi @PureWeen , I have rebased the PR to main.
/rebase
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
Can you add a test?
I have added test cases @PureWeen
/rebase
/azp run
/azp run