Skip to content

Fix for Shell tab visibility not updating when navigating back multiple pages#34280

Draft
BagavathiPerumal wants to merge 2 commits intodotnet:mainfrom
BagavathiPerumal:fix-33351
Draft

Fix for Shell tab visibility not updating when navigating back multiple pages#34280
BagavathiPerumal wants to merge 2 commits intodotnet:mainfrom
BagavathiPerumal:fix-33351

Conversation

@BagavathiPerumal
Copy link
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Root cause

The issue occurs because of the navigation sequence used in OnPopToRootAsync() where the platform navigation is triggered before the root page’s lifecycle events are fired. When Shell.Current.GoToAsync("../..") is used, the method InvokeNavigationRequest() executes first, which sends the navigation request to the native platform handlers.

The platform then commits the UI changes immediately. Only after this process, the root page’s OnAppearing() method is called. Since Shell.SetTabBarIsVisible() is typically invoked inside OnAppearing(), it runs too late, after the UI has already been rendered, causing the TabBar visibility change to be ignored.

This timing mismatch does not occur with single-level navigation (GoToAsync("..")) because that flow correctly triggers lifecycle events before the platform navigation begins.

Description of Issue Fix

The fix involves reordering the execution sequence within OnPopToRootAsync() so that PresentedPageAppearing() runs before InvokeNavigationRequest(), ensuring OnAppearing() is triggered early enough for updates such as Shell.SetTabBarIsVisible() to be applied before the platform finalizes the navigation UI.

Additionally, the stack cleanup loop was refined to skip calling SendDisappearing() on the top page since it is already handled by PresentedPageDisappearing(), thereby avoiding duplicate lifecycle events while still notifying intermediate pages. This change aligns multi level pop to root behavior with single level pop, providing consistent lifecycle handling without introducing breaking changes.

Tested the behavior in the following platforms.

  • Windows
  • Mac
  • iOS
  • Android

Issues Fixed

Fixes #33351

Output

Before Issue Fix After Issue Fix
33351-BeforeFix.mov
33351-AfterFix.mov

…rm navigation to ensure Shell TabBar visibility is applied correctly during multi-level back navigation.
@github-actions
Copy link
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 34280

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 34280"

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Feb 27, 2026
@sheiksyedm sheiksyedm added area-controls-shell Shell Navigation, Routes, Tabs, Flyout community ✨ Community Contribution labels Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-shell Shell Navigation, Routes, Tabs, Flyout community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Changing Shell Tab Visibility when navigating back multiple pages ignores Shell Tab Visibility

2 participants