Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.
This repository was archived by the owner on May 1, 2024. It is now read-only.

[Bug] When navigating back to a previous page (modal stack), OnAppearing() is not called #13527

@gentledepp

Description

@gentledepp

Description

When you have multiple pages in a modal stack and you navigate back, the OnAppearing() callback of the previous page that you return to will only be called for the most inner level.
E.g.: You have 3 modal pages: 1, 2 and 3. You start with page 1, then you navigate to 2 and from 2 to 3 (modally) => your stack will be 1/2/3;
Now, navigating back from 3 to 2 will call 2.OnAppearing(), but navigating back from 2 to 1 will not call 1.OnAppearing() wich breaks a lot of things!

This is because when you navigate to the next modal leve, UAP Platform.cs line 348 overwrites any _modalBackgroundPage even if there is already one!

Steps to Reproduce

  1. Create a sample that has a navigation page, pushes a nother navigation page as modal and then a 2nd one
  2. Navigating back one step to the 1st modal navigation page still triggers its "OnAppearing" callback
  3. However, navigating back to the root does not trigger "OnAppearing" anymore

Expected Behavior

Whenever you navigate back to the previous page, its "OnAppearing" callback should be called

Actual Behavior

It works if you only have one level of nesting. However, as soon as you have 2 modal pages, the outer ones "OnAppearing" is not called anymore

Basic Information

  • Version with issue: 4.8.x and 5.0.0

  • Last known good version: Anyhing before commit d103974 which broke everything (issue that was resoled: Modal Page with transparent background #8551)

  • Platform Target Frameworks:

    • UWP: any version. This is a bug in UAP Platform.cs
  • Android Support Library / AndroidX Version:

  • Affected Devices: all UWP devices

@jfversluis this issue occurs because of your fix for tranparent background of modals

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions