@@ -162,34 +162,43 @@ class UIPageViewControllerImpl extends UIPageViewController {
162
162
let scrollViewHeight = this . view . bounds . size . height + conditionalSafeAreaBottom ;
163
163
164
164
if ( owner . tabStrip && this . tabBar ) {
165
- const viewWidth = this . view . bounds . size . width ;
166
- const viewHeight = this . view . bounds . size . height ;
167
- const tabBarHeight = this . tabBar . frame . size . height ;
168
- let tabBarTop = safeAreaInsetsTop ;
169
-
170
- scrollViewTop = tabBarHeight ;
171
- scrollViewHeight = this . view . bounds . size . height - tabBarHeight + conditionalSafeAreaBottom ;
172
-
173
- const tabsPosition = owner . tabsPosition ;
174
- if ( tabsPosition === TabsPosition . Bottom ) {
175
- tabBarTop = viewHeight - tabBarHeight - safeAreaInsetsBottom ;
176
- scrollViewTop = this . view . frame . origin . y ;
177
- scrollViewHeight = viewHeight - tabBarHeight ;
178
- }
179
-
180
- let parent = owner . parent ;
181
-
182
- // Handle Angular scenario where Tabs is in a ProxyViewContainer
183
- // It is possible to wrap components in ProxyViewContainers indefinitely
184
- while ( parent && ! parent . nativeViewProtected ) {
185
- parent = parent . parent ;
165
+ if ( owner . tabStrip . visibility === 'visible' ) {
166
+ this . tabBar . hidden = false ;
167
+ } else {
168
+ this . tabBar . hidden = true ;
186
169
}
187
-
188
- if ( parent && majorVersion > 10 ) {
189
- // TODO: Figure out a better way to handle ViewController nesting/Safe Area nesting
190
- tabBarTop = Math . max ( tabBarTop , parent . nativeView . safeAreaInsets . top ) ;
170
+ // failsafe with !this.tabBar.hidden just in some really odd case where hidden is false and collapse is true
171
+ // which should never happen
172
+ if ( ! owner . tabStrip . isCollapsed || ! this . tabBar . hidden ) {
173
+ const viewWidth = this . view . bounds . size . width ;
174
+ const viewHeight = this . view . bounds . size . height ;
175
+ const tabBarHeight = this . tabBar . frame . size . height ;
176
+ let tabBarTop = safeAreaInsetsTop ;
177
+
178
+ scrollViewTop = tabBarHeight ;
179
+ scrollViewHeight = this . view . bounds . size . height - tabBarHeight + conditionalSafeAreaBottom ;
180
+
181
+ const tabsPosition = owner . tabsPosition ;
182
+ if ( tabsPosition === TabsPosition . Bottom ) {
183
+ tabBarTop = viewHeight - tabBarHeight - safeAreaInsetsBottom ;
184
+ scrollViewTop = this . view . frame . origin . y ;
185
+ scrollViewHeight = viewHeight - tabBarHeight ;
186
+ }
187
+
188
+ let parent = owner . parent ;
189
+
190
+ // Handle Angular scenario where Tabs is in a ProxyViewContainer
191
+ // It is possible to wrap components in ProxyViewContainers indefinitely
192
+ while ( parent && ! parent . nativeViewProtected ) {
193
+ parent = parent . parent ;
194
+ }
195
+
196
+ if ( parent && majorVersion > 10 ) {
197
+ // TODO: Figure out a better way to handle ViewController nesting/Safe Area nesting
198
+ tabBarTop = Math . max ( tabBarTop , parent . nativeView . safeAreaInsets . top ) ;
199
+ }
200
+ this . tabBar . frame = CGRectMake ( 0 , tabBarTop , viewWidth , tabBarHeight ) ;
191
201
}
192
- this . tabBar . frame = CGRectMake ( 0 , tabBarTop , viewWidth , tabBarHeight ) ;
193
202
} else {
194
203
this . tabBar . hidden = true ;
195
204
}
0 commit comments