Rg.plugins.popup: macOS: Popup not shown

Created on 27 Jan 2021  路  11Comments  路  Source: rotorgames/Rg.Plugins.Popup

馃悰 Bug Report

If the popup is called the background is dimmed but the content will not show up.

I call this via:

PopupPage pageMobile = NavigateOnMobile(navigation, content, startEndPosition);
await navigation.PushPopupAsync(pageMobile);
private static PopupPage NavigateOnMobile(
  INavigation navigation, ContentView content, MoveAnimationOptions startEndPosition)
{
  MoveAnimation animation = new MoveAnimation(startEndPosition, startEndPosition);
  animation.HasBackgroundAnimation = true;
  content.Margin = 0;
  PopupPage pageMobile = new PopupPage
  {
    CloseWhenBackgroundIsClicked = true,
    Content = content,
    Animation = animation,
    HasSystemPadding = true,
    HasKeyboardOffset = true,
    Padding = 0,
    SystemPaddingSides = PaddingSide.Top
  };
  pageMobile.BackgroundClicked += async (sender, args) => { await navigation.PopAllPopupAsync(); };
  return pageMobile;
}

If I set a breakpoint on PushPopupAsync() it works. So I tested if a Task.Delay() would be a workaround. But no, it doesn't work.
This code works on iOS.

Expected behavior

Popup shown

Reproduction steps

Run the code and add some content.

Configuration

Version: 2.0.0.10

Platform:

  • [ ] :iphone: iOS
  • [ ] :robot: Android
  • [ ] :checkered_flag: WPF
  • [ ] :earth_americas: UWP
  • [x] :apple: MacOS
  • [ ] :tv: tvOS
  • [x] :monkey: Xamarin.Forms
bug verify

All 11 comments

hey @Suplanus could you make a small example of what you have an include it here, so I know exactly the use case.

I will make a small example. Give me some time 馃殌

I am also experiencing this issue on a production iOS app. The issue seems to be when using XCode 12. When I rolled back to XCode 11.7 on my build server, the dialogs worked as they did previously.

I have experienced this issue fort reasons:

  1. The first reason was because the behind code file was in the wrong folder.
  2. The second reason was because I dragged my window to my external monitor. Then it behaves exactly as you described (dimmed and no popup). Move back to laptop screen and popup shows.

@teamtam this is very interesting, are you running your iOS app on an M1 Mac?

And @ajtruckle I wonder if this matches with your issue.

Ironically, my iOS simulator seems fine on either screen. It is my macOS build that isn't ok.

@LuckyDucko I am still working on this, but this is what I have found so far.

Issue arose with builds from both my dev machine and build server.

  • Dev machine is a 2015 vintage Intel based one
  • Build server is Azure Devops _macOS-10.15_ image

Tested on both iPhone XR and iPhone 12 on iOS 14 which causes the issue. Dialogs work fine with the same build(s) on an iPhone 11 with iOS 13.4.1.

I have since realised I was using an old 1.* version of the library. I have tried updating to the latest in the 1.* series - with that the dialogs appear but crashes intermittently/randomly. Unfortunately I cannot upgrade to the latest 2.* version of the library yet as my app is stuck with Xamarin.Forms 4.4 for the time being. As such, you can probably ignore my comments for the time being. Once I get up to the latest Xamarin.Forms and your library with it, if it's still a problem then I can raise a new issue.

I recommend setting system padding to false and checking if this still happens @Suplanus. As I believe it may be an issue with external screens being different resolutions

@LuckyDucko just letting you know I got to the bottom of my issue! It was an API change introduced by Apple with iOS 14 for one of the controls I use in a renderer, which I wasn't previously aware of. This caused a silent error with Xamarin.Forms 5, which resulted in the symptoms described above. I still need to go through formal testing with my business, but otherwise the library seems to work fine with Xamarin.Forms 5 + iOS 14 + XCode 12. Please disregard my earlier comments.

@teamtam thanks for letting me know, this is good news to have.

If @Suplanus finds no further issue, I'll close this issue

I will test it. If there are (new) issues with macOS, I will reopen.
Thanks 馃挅

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Phenek picture Phenek  路  6Comments

ChrisRisner picture ChrisRisner  路  4Comments

DevendraMaran picture DevendraMaran  路  4Comments

luis-barreira picture luis-barreira  路  5Comments

VladislavAntonyuk picture VladislavAntonyuk  路  3Comments