XamarinCommunityToolkit icon indicating copy to clipboard operation
XamarinCommunityToolkit copied to clipboard

[Bug] [iOS] Unable to open second level popup (e.g. to open popup B from popup A)

Open bondarenkod opened this issue 3 years ago • 12 comments

Description

iOS platform: Unable to display child popup when another is presented. When you are trying to present child popup you can observe the following message in the Output window:

[Presentation] Attempt to present <Xamarin_CommunityToolkit_UI_Views_PopupRenderer: 0x7ff59af2f1c0> on
<Xamarin_Forms_Platform_iOS_PlatformRenderer: 0x7ff59ac0d750> 
(from <Xamarin_CommunityToolkit_Sample_iOS_Renderers_NoLineNavigationPageRenderer: 0x7ff59d0ea400>) 
which is already presenting <Xamarin_CommunityToolkit_UI_Views_PopupRenderer: 0x7ff59a90f2b0>.

This is happening because the popup control renderer is trying to be displayed on the same ui view controller twice.

I tried a small POC workaround, where I displayed the child popup using the parent popup view controller and it worked as expected: image

Link to Reproduction Sample

repro repo https://github.com/bondarenkod/XamarinCommunityToolkit/tree/bdf-issue-samples

Steps to Reproduce

  1. Start the XCT.Sample app
  2. Run the app using the iOS platform as the target
  3. Test Cases => Popup, GitHub #1764
  4. Press the Display Main Popup button.
  5. On the opened popup then press the display child popup button

Expected Behavior

By pressing the display child popup button the child popup must be opened

Actual Behavior

iOS does not display child popups.

Reproduction imagery

iOS:

https://user-images.githubusercontent.com/3184414/146064877-a95206b3-727b-4852-a98d-7778fc094b43.mp4

Android (OK, working as expected):

https://user-images.githubusercontent.com/3184414/146066244-f1f182c0-aeb9-4d79-a59e-1528e3a96077.mp4

bondarenkod avatar Dec 14 '21 18:12 bondarenkod

Will there be any fixes about this issue? Android works good but iOS cant open Popup from a Popup.

planyazilim avatar Jan 14 '22 12:01 planyazilim

bodarenko do you have a solution fro this issue? I checked your solution but you put it community toolkit code.

planyazilim avatar Jan 14 '22 12:01 planyazilim

bodarenko do you have a solution fro this issue? I checked your solution but you put it community toolkit code.

Not yet, my solution is poc only, more work is required.

bondarenkod avatar Jan 15 '22 20:01 bondarenkod

I am having this issue also. Hopefully, a fix is in the pipeline.

victordscott avatar Mar 04 '22 17:03 victordscott

@bondarenkod are you using .NET MAIU already? If so I would like to know if you are able to try the Popup on CommunityToolkit.MAUI, I know this issue lives there as well, but I'm wondering if your fix will work there, if so let me know and I can make an effort to implement it on GA

pictos avatar Mar 23 '22 23:03 pictos

m wondering if your fix will work there, if so let me know and I can make an effort to implement it on GA

Will try in a few days.

bondarenkod avatar Mar 29 '22 08:03 bondarenkod

@bondarenkod are you using .NET MAIU already? If so I would like to know if you are able to try the Popup on CommunityToolkit.MAUI, I know this issue lives there as well, but I'm wondering if your fix will work there, if so let me know and I can make an effort to implement it on GA

@pictos
Hello! I'm sorry for the delay, I had to wait till the weekend. Also, I'm struggling with testing the project due to issues with my copy of VS2022. The VS randomly display target devices in the window, in 3 hours I've seen full set of attached devices only one time. That allowed me to complete the test on the Android device. So, the iOS part will be added a bit later, I'm going to reinstall the VS again. 03_04_2022__21_50_15__0bb5c6a2-513d-443f-b7b5-adb65702dd5d

Demo project link Test results, child popup working as expected at:

  • iOS - TBD
  • Android - YES
  • Windows - NO

Video:

iOS TBD

Android https://user-images.githubusercontent.com/3184414/161443522-56ad3458-5a5e-4643-8b97-1f4b6fcc311e.mp4

Windows https://user-images.githubusercontent.com/3184414/161443468-781ba9bf-864f-44f3-9d9a-32290dbbe4e6.mp4

bondarenkod avatar Apr 03 '22 18:04 bondarenkod

@bondarenkod relax, take your time (: and thanks for looking into this.

I'm afraid that windows doesn't support this scenario, maybe we can block the LightDismiss feature and only allow the removal of popups when the user clicks on something inside the presented popup.

pictos avatar Apr 03 '22 19:04 pictos

I did a clean setup for win & vs 2022 preview on virtual machine. I am still not able to see any targets except local 'Windows machine'. Will wait till the next update, maybe it will help.

bondarenkod avatar Apr 04 '22 19:04 bondarenkod

@bondarenkod just to make sure, are you using the latest VS 2022 preview? And are you checking the Xamarin workload option on installer?

pictos avatar Apr 04 '22 20:04 pictos

I'm guessing there hasn't been any movement on this issue since April? I have encountered it myself testing some nested popups in iOS 16.

mrbelk avatar Oct 11 '22 21:10 mrbelk

Do we have any solution for this issue in Xamarin forms ?

srpujari17 avatar Dec 27 '22 14:12 srpujari17