10000 fix(ios-tabs): handle nesting proxy view container (#7755) · NativeScript/NativeScript@92c3338 · GitHub
[go: up one dir, main page]

Skip to content

Commit 92c3338

Browse files
MartoYankovSvetoslavTsenov
authored andcommitted
fix(ios-tabs): handle nesting proxy view container (#7755)
1 parent e3ed028 commit 92c3338

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tns-core-modules/ui/tabs/tabs.ios.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,17 @@ class UIPageViewControllerImpl extends UIPageViewController {
150150
scrollViewHeight = this.view.frame.size.height - safeAreaInsetsBottom;
151151
}
152152

153-
const parent = owner.parent;
153+
let parent = owner.parent;
154+
155+
// Handle Angular scenario where Tabs is in a ProxyViewContainer
156+
// It is possible to wrap components in ProxyViewContainers indefinitely
157+
while (parent && !parent.nativeViewProtected) {
158+
parent = parent.parent;
159+
}
160+
154161
if (parent && majorVersion > 10) {
155162
// TODO: Figure out a better way to handle ViewController nesting/Safe Area nesting
156-
tabBarTop = Math.max(tabBarTop, owner.parent.nativeView.safeAreaInsets.top);
163+
tabBarTop = Math.max(tabBarTop, parent.nativeView.safeAreaInsets.top);
157164
}
158165

159166
this.tabBar.frame = CGRectMake(0, tabBarTop, this.tabBar.frame.size.width, tabBarHeight);

0 commit comments

Comments
 (0)
0