question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CommunityToolkit.Popups and Shell doesn't like each other

See original GitHub issue

Description

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:

MauiTestApp.zip

Steps to Reproduce

  1. Open the attached project
  2. Open the MainPage.xaml.cs
  3. 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:open
  • Created a year ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
CristiSanducommented, Oct 26, 2022

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.

1reaction
pictoscommented, Jun 29, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Popup - .NET MAUI Community Toolkit
The Popup view allows developers to build their own custom UI and present it to their users.
Read more >
Having problems with passing data to Community Toolkit ...
Figuring out how your VMs will pass data between each other's probably one of the more important parts of an app. You have...
Read more >
[BUG] Popup not showing in NavigatedTo event on Shell.
In the NavigatedTo event on the Shell, when I show the Popup it doesn't show up and when I close it I get...
Read more >
Passing data to CommunityToolkit.Maui Popup
Documentation shows how to send a result from Popup back to the page but doesn't show how to pass data to the Popup...
Read more >
Showing Popups in .NET MAUI with . ...
With the help of the .NET MAUI Community Toolkit showing popups is a breeze! In this video I introduce you to how to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found