Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.
This repository was archived by the owner on May 1, 2024. It is now read-only.

[Bug] [iOS] Unable to chain display Popup calls or to display two popup simultaneously  #1761

@bondarenkod

Description

@bondarenkod

Description

It is impossible to display the second popup after awaiting the result from the first one on the iOS platform.
It's happening due to the next logic in the iOS Popup's renderer:

async void OnDismissed(object? sender, PopupDismissedEventArgs e)
{
	if (ViewController != null)
		await ViewController.DismissViewControllerAsync(true);
}

The result is returned before the controller is removed (dismissed) from the stack (iOS's ViewController).

Stack Trace

[Presentation] Attempt to present <Xamarin_CommunityToolkit_UI_Views_PopupRenderer: 0x7fc154247c50> on <Xamarin_Forms_Platform_iOS_PlatformRenderer: 0x7fc15372d130> (from <Xamarin_CommunityToolkit_Sample_iOS_Renderers_NoLineNavigationPageRenderer: 0x7fc15489d400>) which is already presenting <Xamarin_CommunityToolkit_UI_Views_PopupRenderer: 0x7fc15460ddb0>.

Link to Reproduction Sample

Use this 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 #1761
  4. Press the Popup A, Popup B button.

Expected Behavior

After pressing Close on the displayed popup the next popup should be opened.

Actual Behavior

The second popup is not displayed.

Workaround

Adding await Task.Delay(100...500); between calls is the workaround solution.
You can test this solution by pressing Popup A, Task.Delay, Popup B button.

Reproduction imagery

iOS:

14_12_2021__21_36_09__cf66c955-4c78-486b-b647-90d50b83bc54.mp4

Android (working as expected by default):

Screen_Recording_20211214-213809.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working. Breaky break.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions