Skip to content
This repository has been archived by the owner on Feb 25, 2020. It is now read-only.

Commit

Permalink
fix: fix issue when setting position to absolute for tab bar
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Oct 9, 2019
1 parent b5a7a5c commit c8e1cd2
Showing 1 changed file with 33 additions and 4 deletions.
37 changes: 33 additions & 4 deletions src/views/BottomTabBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -343,14 +343,45 @@ class TabBarBottom extends React.Component<BottomTabBarProps, State> {
const activeBackgroundColor = this._getActiveBackgroundColor();
const inactiveBackgroundColor = this._getInactiveBackgroundColor();

const {
position,
top,
left = 0,
bottom = 0,
right = 0,
margin,
marginTop,
marginLeft,
marginBottom,
marginRight,
marginHorizontal,
marginVertical,
...innerStyle
} = StyleSheet.flatten(style || {});

const containerStyle = {
position,
top,
left,
bottom,
right,
margin,
marginTop,
marginLeft,
marginBottom,
marginRight,
marginHorizontal,
marginVertical,
};

const tabBarStyle = [
styles.tabBar,
isDark ? styles.tabBarDark : styles.tabBarLight,
// @ts-ignore
this._shouldUseHorizontalLabels() && !Platform.isPad
? styles.tabBarCompact
: styles.tabBarRegular,
style,
innerStyle,
];

return (
Expand All @@ -374,6 +405,7 @@ class TabBarBottom extends React.Component<BottomTabBarProps, State> {
position: this.state.keyboard ? 'absolute' : null,
}
: null,
containerStyle,
]}
pointerEvents={
keyboardHidesTabBar && this.state.keyboard ? 'none' : 'auto'
Expand Down Expand Up @@ -454,9 +486,6 @@ const styles = StyleSheet.create({
borderTopColor: ThemeColors.dark.headerBorder,
},
container: {
left: 0,
right: 0,
bottom: 0,
elevation: 8,
},
tabBarCompact: {
Expand Down

0 comments on commit c8e1cd2

Please sign in to comment.