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.

[BUG] Repeatedly displaying and hiding the popup at short intervals does not display the Popup as intended on iOS.

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the “Reporting a bug” section on Contributing file?

Current Behavior

This issue transfer from from Discussion #1202. Since I was able to write code that can easily reproduce the problem, I uploaded the source code to github.

I am using Popup to display the indicator. Indicators using Popup are displayed before the start of processing and closed after the end of processing. The length of the processing varies, some long, some short.

The Indicator using the Popup is displayed as follows.

private void ShowIndicator()
{
    if (pIndicator == null)
    {
        pIndicator = new Indicator();
        this.ShowPopup(pIndicator);
    }
}

The Indicator using the Popup is closed as follows.

private void CloseIndicator()
{
    if (pIndicator != null)
    {
        pIndicator.Close();
        pIndicator = null;
    }
}

pIndicator is an instance of Indicator class that inherits from Popup class and is a class variable. Popups are managed by class variables, and only one Popup is displayed at a time.

private Indicator pIndicator = null;

I use it as follows.

ShowIndicator();
GetTestItem();
CloseIndicator();

If there is no problem, it will be displayed as follows.

Capture_001

If the following warning is displayed, it will be displayed as follows.

Warning: Attempt to dismiss from view controller <CommunityToolkit_Maui_Core_Views_MauiPopup: 0x16c8d4250> while a presentation or dismiss is in progress!

Capture_002

Below is a video of the issue being reproduced.

https://github.com/CommunityToolkit/Maui/assets/125236133/6acfcb64-e1be-4fb8-9657-854d563d2b12

A Indicator using an Popup will appear in a position other than the center of the screen and will not close at all. The above phenomenon rarely occurs.

As far as I can see from the warnings, it looks like the object was not destroyed immediately after calling the Popup’s Close method and is still there.

The problem occurs in both of the repros below. The former is the reproduction code described in Discussion #1202. The latter is the reproducible code described in this issue.

https://github.com/cat0363/MauiComm-IssuePopup.git https://github.com/cat0363/MauiComm-IssuePopup2.git

Expected Behavior

I expected the indicator to show/hide even after calling ShowPopup and Close in succession.

Steps To Reproduce

The steps to reproduce are as follows.

  1. Launch the app uploaded to github with the device on iOS.
  2. Scrolls the ScrollView downward many times.

In step 2, the Indicator remains displayed at the bottom of the screen, blocking scrolling.

Link to public reproduction project repository

https://github.com/cat0363/MauiComm-IssuePopup2.git

Environment

- .NET MAUI CommunityToolkit:5.2.0
- OS:iOS 16.4
- .NET MAUI:7.0.86

Anything else?

No response

Issue Analytics

  • State:closed
  • Created 4 months ago
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
brminnickcommented, Jun 21, 2023

Thanks for the heads up!

I’ve added linked #1213 to the PR so that it’ll be closed when the PR is merged 👍

1reaction
cat0363commented, Jun 21, 2023

Hi, @brminnick By solving Issue #1111 with PR #1223, which you are currently working on, this issue will also be resolved. I was able to confirm that using PR #1223 fixed the issue. This issue was resolved by awaiting using the CloseAsync method. Once #1222 is closed, I will close this issue. Popup behavior is now what I expected. Thank you.

It turns out that the solution I posted earlier only guarded the occurrence of the problem, not the root solution. By controlling the calls to the PresentViewController and DismissViewControllerAsync methods using the ViewController’s IsBeingPresented and IsBeingDismissed property values, the phenomenon no longer occurs, but when I checked the Popup display count, it was not the intended count.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to get location information on iOS 16.4 beta 4, ...
The first time, a pop-up requesting permission for Safari (WKWebView) location information was displayed. The second time, location permissions for the ...
Read more >
I keeping having a message pop up on my p…
A message. Infodavis.com issued by R3. Not trusted. Cannot be verified Keeps popping up on my screen daily. So disturbing. I feel violated...
Read more >
Magnific Popup - Browser scrolls on the top on image click
I am using Magnific Popup plugin for displaying image in lightbox.When I click on the image in Chrome, the browser scrolls on the...
Read more >
Top 18 Most Common AngularJS Developer Mistakes
Sheer size of the AngularJS can easily lead to many mistakes. In this article you will learn about most common AngularJS developer mistakes...
Read more >
macOS Ventura: 50 New Features and Changes Worth ...
macOS Ventura is a significant update that... ... (if you don't have the sidebar showing, select View -> Show Sidebar in the menu...
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