CommunityToolkit.Popups and Shell doesn't like each other
See original GitHub issueDescription
After debugging and investigating some bugs on PopupView
control I realized that most of the bugs are caused when the dev uses Shell
, what’s sad because Shell
is the new way to go for mobile apps with .NET MAUI. Otherwise, if the MainPage
is a regular ContentPage
or a NavigationPage
everything works as expected.
In this bug when I open the popup directly on the first page its content disappears (iPhone) or the app crashes (macOS).
During my debug sessions I couldn’t find anything that could indicate that issues are on my end (but I don’t discard this possibility), and the PopupView
behaves differently depending on the scenario, so I’m opening a bug report here to ask for some help to see if maybe there’s something on Shell
.
Reproduction:
Steps to Reproduce
- Open the attached project
- Open the MainPage.xaml.cs
- Follow the instructions on the page
Version with bug
6.0 (current)
Last version that worked well
Release Candidate 2
Affected platforms
iOS, macOS
Affected platform versions
iOS 15.5
Did you find any workaround?
They are described on the repro.
Relevant log output
On iOS:
2022-06-10 20:50:24.171262-0300 MauiTestApp[14632:3865149] [Presentation] Presenting view controller <CommunityToolkit_Maui_Core_Views_MauiPopup: 0x7fbad142d0d0> from detached view controller <Microsoft_Maui_Platform_PageViewController: 0x7fbacfc3c830> is discouraged.
Issue Analytics
- State:
- Created a year ago
- Comments:11 (4 by maintainers)
Top GitHub Comments
I had the same problem on IOS, but in my case the problem of the crash was not the shell, in the Popup the main layout need to be given a height and width.
Hey @EPS-Lac, Shane and I discussed the current implementation for the MCT popup and he suggested changing the
ViewController
that we’re using. I’m working on that right now and should have feedback during the weekend. If the suggestion works then the fix will be on MCT if not will need more investigation.