Xamarin.Forms icon indicating copy to clipboard operation
Xamarin.Forms copied to clipboard

OnAppearing not being called for the current page in shell instead called for parent page

Open UwpDev opened this issue 6 years ago • 3 comments

Description

When media picker is opened from a detail page in shell, then after returning from the picker task completion only the on appearing of the parent page is called but not of the detail page.

I have attached Xaminals Xaminals.zip sample code in which I have added a gallery picker on button click in CatDetailPage

Steps to Reproduce

  1. On app launch, click on any cat item in CatsPage, this will cause navigation to CatDetailPage
  2. In CatDetailPage, click on "Open File Picker" button, this will open an action sheet
  3. Select "Choose from gallery" from the action sheet, it will open gallery/photos app
  4. From the gallery app click back or select an image, it will navigate back to CatDetailPage
  5. Observe that OnAppearing is not called for CatDetailPage but is called for CatsPage

Expected Behavior

The OnAppearing should be called for CatDetailPage

Actual Behavior

The OnAppearing of CatsPage is called

Basic Information

  • Version with issue: 4.2.0.848062
  • Last known good version: Not known
  • IDE: Visual Studio 2019

Reproduction Link

Xaminals.zip

UwpDev avatar Oct 04 '19 22:10 UwpDev

You can also reproduce this by just backgrounding the app while on the CatsDetailsPage and then coming back to it

PureWeen avatar Oct 04 '19 23:10 PureWeen

@PureWeen I found another issue related to this. If after backgrounding and coming back to the app, I try to call await Shell.Current.Navigation.PopToRootAsync(false); then the OnAppearing does not get called for any page.

I have added a button to call PopToRootAsync in the Xaminals sample which can be found below Xaminals.zip

UwpDev avatar Oct 05 '19 04:10 UwpDev

Does this issue occur on both iOS & Android for you? I'm only experiencing this issue on Android.

LittleBoxOfChicken avatar Oct 17 '19 09:10 LittleBoxOfChicken