Skip to content

Commit

Permalink
Fix With 1.0.9 popup doesnt dismiss whern click outside popup wndow #14
Browse files Browse the repository at this point in the history
  • Loading branch information
microspaze committed May 15, 2024
1 parent 40816c5 commit e563199
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion RGPopup.Maui/Platforms/iOS/Platform/PopupWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ public override UIView HitTest(CGPoint point, UIEvent? uievent)
return null!;

var nativeView = pageHandler?.PlatformView;
var scrollView = formsElement.Content?.Handler?.PlatformView as UIView;
var contentView = formsElement.CoreContent?.Handler?.PlatformView as UIView;
var safePadding = formsElement.SafePadding;
if ((formsElement.BackgroundClickedCommand != null || formsElement.BackgroundInputTransparent || formsElement.CloseWhenBackgroundIsClicked)
&& Math.Max(SafeAreaInsets.Left, safePadding.Left) < point.X && point.X < (Bounds.Width-Math.Max(SafeAreaInsets.Right, safePadding.Right))
&& Math.Max(SafeAreaInsets.Top, safePadding.Top) < point.Y && point.Y < (Bounds.Height-Math.Max(SafeAreaInsets.Bottom, safePadding.Bottom))
&& (hitTestResult.Equals(nativeView) || hitTestResult.Equals(contentView)))
&& (hitTestResult.Equals(nativeView) || hitTestResult.Equals(contentView) || hitTestResult.Equals(scrollView) || hitTestResult.Equals(scrollView?.Subviews?.FirstOrDefault())))
{
_ = formsElement.SendBackgroundClick();
if (formsElement.BackgroundInputTransparent)
Expand Down

0 comments on commit e563199

Please sign in to comment.