8000 fix(ios): popover delegate should ignore non-native views (#10609) · NativeScript/NativeScript@ba3316e · GitHub
[go: up one dir, main page]

Skip to content {"props":{"docsUrl":"https://docs.github.com/get-started/accessibility/keyboard-shortcuts"}}

Commit ba3316e

Browse files
authored
fix(ios): popover delegate should ignore non-native views (#10609)
1 parent 73f9827 commit ba3316e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/core/ui/core/view/index.ios.ts

Lines changed: 5 additions & 1 deletion
Diff line number
Original file line numberDiff line change
@@ -1002,7 +1002,11 @@ export class View extends ViewCommon implements ViewDefinition {
10021002
const popoverPresentationController = controller.popoverPresentationController;
10031003
this._popoverPresentationDelegate = IOSHelper.UIPopoverPresentationControllerDelegateImp.initWithOwnerAndCallback(new WeakRef(this), this._closeModalCallback);
10041004
popoverPresentationController.delegate = <UIPopoverPresentationControllerDelegate>this._popoverPresentationDelegate;
1005-
const view = parent.nativeViewProtected;
1005+
let view: UIView;
1006+
do {
1007+
view = parent.nativeViewProtected;
1008+
parent = parent.parent as View;
1009+
} while (parent && !view);
10061010
// Note: sourceView and sourceRect are needed to specify the anchor location for the popover.
10071011
// Note: sourceView should be the button triggering the modal. If it the Page the popover might appear "behind" the page content
10081012
popoverPresentationController.sourceView = view;

0 commit comments

Comments
 (0)
0