Skip to content

Commit

Permalink
Ensure that SetContextMenuConfiguration always calls the completion h…
Browse files Browse the repository at this point in the history
…andler (#21436)
  • Loading branch information
dustin-wojciechowski committed Mar 27, 2024
1 parent d656c4e commit 705b551
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Core/src/Platform/iOS/MauiWebViewUIDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,21 @@ public override void SetContextMenuConfiguration(WKWebView webView, WKContextMen
if (!OperatingSystem.IsIOSVersionAtLeast(13))
return;

UIContextMenuConfiguration? uIContextMenuConfiguration = null;
foreach (var interaction in webView.Interactions)
{
if (interaction is MauiUIContextMenuInteraction cmi)
{
var contextMenu = cmi.GetConfigurationForMenu();
if (contextMenu != null)
completionHandler(contextMenu);
{
uIContextMenuConfiguration = contextMenu;
}

break;
}
}

completionHandler(uIContextMenuConfiguration!);
return;
}

Expand Down

0 comments on commit 705b551

Please sign in to comment.