-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Bug] OnAppearing/OnDisappearing Lifecycle Fixes #6919
Comments
flag for EnableNewLifeCycleEvents that can become default in 5.0.0 => that's sound good! |
We really need this bug fixed for we're having the same issue with a certain page's on appearing method executing even if it's never the active tab |
Could this be related? I have a System.NullReferenceException in a method that doesn't really have anything in it that could be causing a NullReferenceException. CardsTabViewModel.OnDisappearing () Android: 7.0 Xamarin Exception Stack: Thread 17677: Thread 17678: Thread 17679: Thread 17680: Thread 17691: Thread 17693: Thread 17694: |
@rscholey I don't think your problem has anything in common. You should debug it to see where exactly the NRE occurs. Also have a look on your XAML code. |
It looks like this is still happening. We simply open a modal page Shell.Current.Navigation.PushModalAsync() and then dismiss it using Navigation.PopModalAsync(); Neither OnAppearing nor OnDisappearing event is called on Android. Are there any suggested work arounds? Can someone point to a pattern how to design/architect the UI without reliable life cycle events such as Appearing and Disappearing? |
@dmitrymal a workaround for me is to use an event or an observable that fires in a service when the page is closed. This event or observable then triggers the OnAppearing on Android. |
Run also into the OnAppearing difference between iOS and Android. iOS is much tool late fired. Please fix it. |
Also running into this. This issue is almost a year old and it's still not fixed. disappointing |
This issue is really annoying, indeed. Can you provide more info on why this hasn't been merged yet? Is it a design decision? |
Just jumped into this issue, really annoying indeed. |
Same here. |
No news on this still? |
Hi @jfversluis and @jsuarezruiz
i would say iOS looks ok. But android is really confusing. |
Description
As a step in the direction of getting #2210 resolved we should first fix OnAppearing/OnDisappearing so that they fire consistently across platform and that we resolve the cases where OnAppearing/OnDisappearing fires at odd times.
Existing Issues
#2240
#2716
#5418
#4986
#4608
Example Ordering issue take from #2210
Example or Ordering Issue
Currently, where MainPage is a TabbedPage you get this:
iOS:
Android:
The issue with the current OnAppearing implementation is that it's a hodge podge of platform hooks and in some cases cross platform. For example currently on iOS OnAppearing fires when ViewDidAppear is called which is OnAppeared not OnAppearing which is inconsistent with Android.
Cases like this on Android TabbedPageRenderer don't make sense
SendAppearing here should just fire from the Element not from the Renderer that way it's cross platform and consistent.
Implementation notes
The text was updated successfully, but these errors were encountered: