Tabs on TabbedPage gone after popping Modal in background
Description
Seen on Android:
When popping a Modal that's displayed over a TabbedPage and sending the app to the background, when resuming the app the tabs are gone.
I've simulated some task before popping the modal. If you send the app to the background during this 2.5s, and resume it when the Modal is actually popped, the tabs on the TabbedPage are no longer displayed.
Summary: navigating in the background results in invisible tabs on TabbedPage
Steps to Reproduce
-
Create a MAUI project with a TabbedPage as MainPage and 2 Tabs
-
Push a third Page from one of the tab pages
await Navigation.PushModalAsync(new ModalPage()); -
Pop the modal on button click in the modal
await Task.Delay(2500);
await Navigation.PopModalAsync();
When backgrounding the app during that 2500 ms Task, and resuming it after, the tabs on the TabbedPage are no longer visible.
Actual result: Tabs are gone
https://github.com/dotnet/maui/assets/169977030/aa91bfcb-edb4-42cf-91c7-228e7c2ff43a
Expected result: Tabs are still visible This is the current behaviour when using a Shell TabBar instead of the TabbedPage
https://github.com/dotnet/maui/assets/169977030/1fe971ec-c309-4c19-82eb-35476c5669d8
Link to public reproduction project repository
https://github.com/VoldersS/TabbedPageBug
Version with bug
8.0.40 SR5
Is this a regression from previous behavior?
Yes, this used to work in Xamarin.Forms
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 14
Did you find any workaround?
Works correctly using Shell, but since it's not supported while also using NavigationPages it's not really a workaround if you need NavigationPages.
Relevant log output
No response
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Open similar issues:
- TabbedPage: content not shown after readding (#21640), similarity score: 0.79
- TabbedPage: WinUI: Back-button persists when swapping to a Tab that does not have a NavigationPage. (#14689), similarity score: 0.78
Closed similar issues:
- Whole App Shell and Shell content disapear when changing between tabs fast enough (Release mode on Android) (#18555), similarity score: 0.80
- [Android] Content wrapped in NavigationPage objects in Tabbed Page disappears after tabs navigating (#9743), similarity score: 0.79
- Switching Tabs after resuming from background throws System.NullReferenceException on Android (#12498), similarity score: 0.78
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Verified this issue with Visual Studio 17.10 Preview 7(8.0.3&8.0.14&8.0.20&8.0.40). Can repro on Android platform with sample project.
Repro'd on my environment, getting this with an enterprise app I'm converting over to MAUI from XF.
Environment:
Microsoft Visual Studio Enterprise 2022 (64-bit) - Current Version 17.10.4
Project Refs:
.NET Version: net8.0
Microsoft.Maui: 8.0.72
CommunityToolkit.Maui: 9.0.2
Stumbling upon this as well. Also it's strange that the tabs disappear while a modal is shown. Definitely wasn't the case in XF.