Skip to content
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

Fix for OnAppearing of Page called again, although this page was on already replaced NavigationStack #25596

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BagavathiPerumal
Copy link
Contributor

Root cause

The issue occurs because the ShellSection.SendAppearing() method triggers PresentedPageAppearing() even when PresentedPage doesn’t match CurrentItem. This mismatch causes the OnAppearing() logic of the previous page to execute at the wrong time, resulting in unintended behavior.

Description of Issue Fix

The fix involves adding the IsPageVisible method to contain the logic for determining if the presented page is the current item. The SendAppearing method was updated to ensure that PresentedPageAppearing is called only if the page is visible, correcting the invocation logic and preventing unintended behavior.

Tested the behavior in the following platforms.

  • Windows
  • Android
  • iOS
  • Mac

Issues Fixed

Fixes #25089

Output

Before Issue Fix After Issue Fix
BeforeFix-OnAppearing.mp4
AfterFix-OnAppearing.mp4

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Oct 30, 2024
@PureWeen
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community ✨ Community Contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OnAppearing of Page called again, although this page was on already replaced NavigationStack
2 participants