Skip to content

Commit

Permalink
[RNMobile] Fix padding bottom in bottom-sheet for phones that don't n…
Browse files Browse the repository at this point in the history
…eed the safe area (#26722)
  • Loading branch information
dratwas authored Nov 5, 2020
1 parent 8582893 commit 5f6514c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 4 additions & 5 deletions packages/block-editor/src/components/inserter/menu.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,7 @@ export class InserterMenu extends Component {
>
<TouchableHighlight accessible={ false }>
<BottomSheetConsumer>
{ ( {
listProps,
safeAreaBottomInset = styles.list.paddingBottom,
} ) => (
{ ( { listProps, safeAreaBottomInset } ) => (
<FlatList
onLayout={ this.onLayout }
key={ `InserterUI-${ numberOfColumns }` } //re-render when numberOfColumns changes
Expand All @@ -160,7 +157,9 @@ export class InserterMenu extends Component {
contentContainerStyle={ [
...listProps.contentContainerStyle,
{
paddingBottom: safeAreaBottomInset,
paddingBottom:
safeAreaBottomInset ||
styles.list.paddingBottom,
},
] }
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const BottomSheetNavigationScreen = ( {
shouldEnableBottomSheetMaxHeight,
setIsFullScreen,
listProps,
safeAreaBottomInset = styles.scrollableContent.paddingBottom,
safeAreaBottomInset,
} = useContext( BottomSheetContext );

const { setHeight } = useContext( BottomSheetNavigationContext );
Expand Down Expand Up @@ -88,7 +88,9 @@ const BottomSheetNavigationScreen = ( {
{ ! isNested && (
<View
style={ {
height: safeAreaBottomInset,
height:
safeAreaBottomInset ||
styles.scrollableContent.paddingBottom,
} }
/>
) }
Expand Down

0 comments on commit 5f6514c

Please sign in to comment.