mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
fix-next: handle view controller nesting in ng (#6472)
This commit is contained in:
@ -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).
|
// 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 tabViewItem = owner.parent;
|
||||||
const tabView = tabViewItem && tabViewItem.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) {
|
if (parent) {
|
||||||
const parentPageInsetsTop = parent.nativeViewProtected.safeAreaInsets.top;
|
const parentPageInsetsTop = parent.nativeViewProtected.safeAreaInsets.top;
|
||||||
const currentInsetsTop = this.view.safeAreaInsets.top;
|
const currentInsetsTop = this.view.safeAreaInsets.top;
|
||||||
|
@ -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.
|
// If the Page is nested, cross check safe area insets on top and bottom with Frame parent.
|
||||||
const frame = owner.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.
|
// 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) {
|
if (frameParent) {
|
||||||
const parentPageInsetsTop = frameParent.nativeViewProtected.safeAreaInsets.top;
|
const parentPageInsetsTop = frameParent.nativeViewProtected.safeAreaInsets.top;
|
||||||
const currentInsetsTop = this.view.safeAreaInsets.top;
|
const currentInsetsTop = this.view.safeAreaInsets.top;
|
||||||
|
Reference in New Issue
Block a user