-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix for Handler not disconnected when removing a non-visible page from the navigation stack #30049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
PureWeen
merged 4 commits into
dotnet:inflight/current
from
praveenkumarkarunanithi:fix-29923
Jun 24, 2025
Merged
Fix for Handler not disconnected when removing a non-visible page from the navigation stack #30049
PureWeen
merged 4 commits into
dotnet:inflight/current
from
praveenkumarkarunanithi:fix-29923
Jun 24, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Hey there @@praveenkumarkarunanithi! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
jsuarezruiz
approved these changes
Jun 23, 2025
PureWeen
pushed a commit
that referenced
this pull request
Jun 25, 2025
…m the navigation stack (#30049) * Update NavigationProxy.cs * test case added * Update Issue29923.cs * fix updated
github-actions bot
pushed a commit
that referenced
this pull request
Jun 26, 2025
…m the navigation stack (#30049) * Update NavigationProxy.cs * test case added * Update Issue29923.cs * fix updated
PureWeen
pushed a commit
that referenced
this pull request
Jun 27, 2025
…m the navigation stack (#30049) * Update NavigationProxy.cs * test case added * Update Issue29923.cs * fix updated
PureWeen
pushed a commit
that referenced
this pull request
Jun 28, 2025
…m the navigation stack (#30049) * Update NavigationProxy.cs * test case added * Update Issue29923.cs * fix updated
github-actions bot
pushed a commit
that referenced
this pull request
Jun 29, 2025
…m the navigation stack (#30049) * Update NavigationProxy.cs * test case added * Update Issue29923.cs * fix updated
github-actions bot
pushed a commit
that referenced
this pull request
Jun 29, 2025
…m the navigation stack (#30049) * Update NavigationProxy.cs * test case added * Update Issue29923.cs * fix updated
github-actions bot
pushed a commit
that referenced
this pull request
Jul 1, 2025
…m the navigation stack (#30049) * Update NavigationProxy.cs * test case added * Update Issue29923.cs * fix updated
github-actions bot
pushed a commit
that referenced
this pull request
Jul 2, 2025
…m the navigation stack (#30049) * Update NavigationProxy.cs * test case added * Update Issue29923.cs * fix updated
github-actions bot
pushed a commit
that referenced
this pull request
Jul 2, 2025
…m the navigation stack (#30049) * Update NavigationProxy.cs * test case added * Update Issue29923.cs * fix updated
github-actions bot
pushed a commit
that referenced
this pull request
Jul 8, 2025
…m the navigation stack (#30049) * Update NavigationProxy.cs * test case added * Update Issue29923.cs * fix updated
github-actions bot
pushed a commit
that referenced
this pull request
Jul 8, 2025
…m the navigation stack (#30049) * Update NavigationProxy.cs * test case added * Update Issue29923.cs * fix updated
github-actions bot
pushed a commit
that referenced
this pull request
Jul 9, 2025
…m the navigation stack (#30049) * Update NavigationProxy.cs * test case added * Update Issue29923.cs * fix updated
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area-navigation
NavigationPage
partner/syncfusion
Issues / PR's with Syncfusion collaboration
platform/android
platform/ios
platform/macos
macOS / Mac Catalyst
platform/windows
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Root Cause
When
Navigation.RemovePage()is used to remove a page from the navigation stack, the handler associated with the removed page is not disconnected. In contrast, methods likePopAsync()orPopModalAsync()trigger proper cleanup, including handler disconnection.The
RemovePage()method modifies the navigation stack without initiating any disposal or disconnection logic for the page's handler. As a result, the Handler property of the removed page remains assigned after removal, which can retain references to platform-specific resources.Platform implementations do not consistently handle this scenario. On iOS, handler disconnection occur through
ShellSectionRenderer.DisposePage()for some scenarios only, but this is not invoked as part ofRemovePage(). On Android and Windows, no corresponding cleanup is performed when removing a page in this way.Description of Change
This change ensures that when a page is removed from the navigation stack using
RemovePage()—and the page is not currently visible—its handler is properly disconnected. The fix is implemented inNavigationProxy.OnRemovePage(), which provides a centralized and platform-agnostic location for handling page removal. This approach ensures consistent behavior across iOS, Android, and Windows, and correctly manages the page lifecycle by disconnecting the handler at the appropriate time.Issues Fixed
Fixes #29923
Tested the behaviour in the following platforms
Screenshots
withoutfix.mov
withfix.mov