-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Tabs within the shell do not execute override the OnAppearing method #8102
Comments
verified repro on android, the breakpoint on |
To generalize this (testing on Android API 31 emulator):
In general, Shell seems to behave as if there is only the first page is the only one integrated into Shell at all... |
Do we have an update on when this will be fixed? From what i can see, this is is really blocking some folks from doing the migration to MAUI. |
Did you guys find any workaround? |
No work around from us. I have spent over a week trying to do different things but non works. I will probably need to remove that and create a custom renderer. Am not sure why MAUI team is not trying to resolve it. I know of at least 100 case of it. No traction on it at all. |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
I have the same problem. Content of a tab is not loading because OnAppearing method is not executed for this tab. |
This is a major bug of huge importance and with great impact. Please work on it soon. |
Sorry to ask again, but apart from the bot notifying this has been put in the backlog, why is there no activity from Microsoft here at all? |
StackOverflow / Can a Shell TabBar have a tab without a content page? shows another use case where the inability to put code in OnAppearing for each page is a fundamental showstopper. No workaround. Given that Maui docs present Shell as the primary means of Navigation, the inability to know when a Page is about to show is a very serious flaw for Maui. My recommended workaround until this is fixed: DON'T USE SHELL, Use NavigationPage. |
Well, I'm glad that by finding this page I realized at least that I am not an idiot, as I was starting to suspect after more than an hour of testing my code. Bummer ! I am working on an accounting application, and this app works with objects (accounts, transfer, expenses, etc) which all have statuses (like "submitted", "accepted", "rejected", and so on). This is done on several pages feeding on the same list of objects and then filtering it. After, for instance, "Approving" an object on page "Approvals", I would like to see my object appearing on the page "Finalized" i.e. I would like to trigger a refresh of the Finalized page. Currently I populate this page by calling a "LoadDataAsync()" method in the constructor (in Finalized.xaml.cs) because calling this LoadDataAsync() method in OnAppearing() will never execute it. So that means that the data is populated once, in the beginning, and will never get refreshed. OnAppearing() does not trigger on this page because it only triggers on the first page in my Tab (which is the only one working properly). By the way, do you know of any way of solving this, short of navigating to this stupid "Finalized" page and setting a bound parameter in its viewmodel to trigger the reload ? I do not want to navigate to this page just so I can refresh it ! Thank you !!! Microsoft, please fix this ! |
Not a workaround, but pub/sub using WeakReferenceManager can be of help in certain situations: https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/messagingcenter?view=net-maui-7.0 |
…he OnAppearing method
…he OnAppearing method
…he OnAppearing method
This issue has been around since Xamarin.Forms (xamarin/Xamarin.Forms#3855) This issue also causes rendering issues for the view attached in the shell tab as it is not initialized properly. For example, items added to an ObservableCollection rendered in a StackLayout with a BindableLayout won't be rendered on the view. |
Is there a workaround for this? It is surprising that a bug this big is not fixed yet. |
Just found this one the hard way today, surprised it's not been addressed yet, bit of a show stopper. |
I don't know what else to do but chime in to bump this every few weeks. Why is nothing happening here from Microsoft's side? Please just tell us what you plan to do or some kind of rough timeline! We are totally blocked from finalizing the migration of our B2B app -which relies on shell navigation baked into all viewmodels- to MAUI... |
This is actually pretty bad for Microsoft to not fix it for this long. We
literally stopped our migration and went back to the latest XF. If I get
some time I will see if I can build out a control in Maui that can handle
it.
…On Wed, Jan 11, 2023, 12:59 AM Stephan Kieburg ***@***.***> wrote:
Just found this one the hard way today, surprised it's not been addressed
yet, bit of a show stopper.
I don't know what else to do but chime in to bump this every few weeks.
Why is nothing happening here from Microsoft's side?
Please just tell us what you plan to do or some kind of rough timeline!
We are totally blocked from completing the migration of our B2B app -which
relies on shell navigation naked into all viewmodels- to MAUI...
—
Reply to this email directly, view it on GitHub
<#8102 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/A2MSCJHSGVR6SSVLZCDJ2Y3WRZK5FANCNFSM5Y6FXPNA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Weekly bump until someone in official capacity deigns to respond. |
For now, please try this as a workaround. https://github.com/PureWeen/ShanedlerSamples/tree/main/ShanedlerSamples/Library/Workarounds Working on a permanent fix now. Apologies for this one falling off the radar for so long 👎 |
Hi @PureWeen , thank you for working on this! I have tried your work-around on my repro ( https://github.com/durandt/maui-issue1-android-tabs ),
But the following is not working:
|
Thank you for testing it out! |
@PureWeen Updated work-around works well, thank you Shane! |
@durandt great to hear!! This fix will be released with SR4. We were a little too late unfortunately to get it in for SR3. |
Can confirm the the workaround works for me too. Thanks Shane! |
Awesome, thank you! When will "SR4" be released? Is it the first Tuesday of the month? February or March? |
Will the fix solve also the following two issues with OnAppearing? There is another issue with OnAppearing not executing (#9531) and another one that causes OnAppearing/OnDisappearing to be executed many times instead of just once (#10161). It would be worth testing the workaround also for them before SR4 is released. |
Hey @PureWeen, I was referred here from #9531. I installed your workaround nuget and added the builder command, but I'm still experiencing the issue with OnAppearing not running correctly - see my comments there (I was commenting there because that was the only OnAppearing issue I could see that was still open). I'm not using shell, so maybe your workaround only works with shell? I'm experiencing the issue in Windows on a Content/NavigationPage. Thanks. |
Description
Only the override of the first Tab is intercepted
MauiTest.zip
Steps to Reproduce
-click hamburger icon
-click Test
-click Second
Version with bug
6.0.400 (current)
Last version that worked well
6.0.312
Affected platforms
I was not able test on other platforms
Affected platform versions
Android 11 - Android 12
Did you find any workaround?
https://github.com/PureWeen/ShanedlerSamples/tree/main/ShanedlerSamples/Library/Workarounds
https://github.com/PureWeen/ShanedlerSamples/blob/main/ShanedlerSamples/MauiProgram.cs#L13
Relevant log output
No response
The text was updated successfully, but these errors were encountered: