fix-next: handle view controller nesting in ng (#6472)

This commit is contained in:
Martin Yankov
2018-10-29 19:22:30 +02:00
committed by dtopuzov
parent b8ca3a4ef8
commit 25df69442f
2 changed files with 18 additions and 2 deletions

View File

@ -889,7 +889,15 @@ export namespace ios {
// The TabView itself is handled by the OS, so we check the TabView's parent (usually a Page, but can be a Layout).
const tabViewItem = owner.parent;
const tabView = tabViewItem && tabViewItem.parent;
const parent = tabView && tabView.parent;
let parent = tabView && tabView.parent;
// Handle Angular scenario where TabView is in a ProxyViewContainer
// Not using instanceof ProxyViewContainer to avoid circular dependency
// TODO: Try moving UILayoutViewController out of view module
if (parent && !parent.nativeViewProtected) {
parent = parent.parent;
}
if (parent) {
const parentPageInsetsTop = parent.nativeViewProtected.safeAreaInsets.top;
const currentInsetsTop = this.view.safeAreaInsets.top;

View File

@ -224,7 +224,15 @@ class UIViewControllerImpl extends UIViewController {
// If the Page is nested, cross check safe area insets on top and bottom with Frame parent.
const frame = owner.parent;
// There is a legacy scenario where Page is not in a Frame - the root of a Modal View, so it has no parent.
const frameParent = frame && frame.parent;
let frameParent = frame && frame.parent;
// Handle Angular scenario where TabView is in a ProxyViewContainer
// Not using instanceof ProxyViewContainer to avoid circular dependency
// TODO: Try moving UIViewControllerImpl out of page module
if (frameParent && !frameParent.nativeViewProtected) {
frameParent = frameParent.parent;
}
if (frameParent) {
const parentPageInsetsTop = frameParent.nativeViewProtected.safeAreaInsets.top;
const currentInsetsTop = this.view.safeAreaInsets.top;