Skip to content

Commit e38a730

Browse files
yogevbdguyca
authored andcommitted
Fix tabBar visibility (#6276)
Hiding bottom tabs through static options during push transitions broke in 6.7.0. Closes #6268
1 parent aa24fa9 commit e38a730

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

e2e/BottomTabs.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,12 @@ describe('BottomTabs', () => {
6767
await elementById(TestIDs.POP_BTN).tap();
6868
await expect(elementById(TestIDs.BOTTOM_TABS)).toBeVisible();
6969
});
70+
71+
it('hide Tab Bar on push from second bottomTabs screen', async () => {
72+
await elementById(TestIDs.SWITCH_TAB_BY_INDEX_BTN).tap();
73+
await elementById(TestIDs.HIDE_TABS_PUSH_BTN).tap();
74+
await expect(elementById(TestIDs.BOTTOM_TABS)).toBeNotVisible();
75+
await elementById(TestIDs.POP_BTN).tap();
76+
await expect(elementById(TestIDs.BOTTOM_TABS)).toBeVisible();
77+
});
7078
});

lib/ios/RNNBasePresenter.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ - (BOOL)getStatusBarVisibility {
120120
}
121121

122122
- (BOOL)hidesBottomBarWhenPushed {
123-
RNNNavigationOptions *withDefault = [self.boundViewController.topMostViewController.resolveOptions withDefault:self.defaultOptions];
123+
RNNNavigationOptions *withDefault = (RNNNavigationOptions *)[[self.boundViewController.topMostViewController.resolveOptions withDefault:self.defaultOptions] mergeOptions:self.boundViewController.options];
124124
return ![withDefault.bottomTabs.visible getWithDefaultValue:YES];
125125
}
126126

playground/src/screens/SecondBottomTabScreen.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ const {
99
PUSH_BTN,
1010
PUSHED_BOTTOM_TABS,
1111
SIDE_MENU_TAB,
12-
FLAT_LIST_BTN
12+
FLAT_LIST_BTN,
13+
HIDE_TABS_PUSH_BTN
1314
} = require('../testIDs')
1415

1516
class SecondBottomTabScreen extends React.Component {
@@ -37,10 +38,15 @@ class SecondBottomTabScreen extends React.Component {
3738
<Button label='Push' onPress={this.push} />
3839
<Button label='Push BottomTabs' testID={PUSH_BTN} onPress={this.pushBottomTabs} />
3940
<Button label='SideMenu inside BottomTabs' testID={SIDE_MENU_INSIDE_BOTTOM_TABS_BTN} onPress={this.sideMenuInsideBottomTabs} />
41+
<Button label='Hide Tabs on Push' testID={HIDE_TABS_PUSH_BTN} onPress={this.hideTabsOnPush} />
4042
</Root>
4143
);
4244
}
4345

46+
hideTabsOnPush = () => Navigation.push(this, component(Screens.Pushed, {
47+
bottomTabs: { visible: false }
48+
}));
49+
4450
push = () => Navigation.push(this, Screens.Pushed);
4551

4652
pushBottomTabs = () => Navigation.push(this, {

0 commit comments

Comments
 (0)