diff --git a/packages/core/ui/core/view/index.ios.ts b/packages/core/ui/core/view/index.ios.ts index 447ee251ca..b2594468a8 100644 --- a/packages/core/ui/core/view/index.ios.ts +++ b/packages/core/ui/core/view/index.ios.ts @@ -1002,7 +1002,11 @@ export class View extends ViewCommon implements ViewDefinition { const popoverPresentationController = controller.popoverPresentationController; this._popoverPresentationDelegate = IOSHelper.UIPopoverPresentationControllerDelegateImp.initWithOwnerAndCallback(new WeakRef(this), this._closeModalCallback); popoverPresentationController.delegate = this._popoverPresentationDelegate; - const view = parent.nativeViewProtected; + let view: UIView; + do { + view = parent.nativeViewProtected; + parent = parent.parent as View; + } while (parent && !view); // Note: sourceView and sourceRect are needed to specify the anchor location for the popover. // Note: sourceView should be the button triggering the modal. If it the Page the popover might appear "behind" the page content popoverPresentationController.sourceView = view;