diff --git a/src/components/BottomSheetWithSearchInput.tsx b/src/components/BottomSheetWithSearchInput.tsx index 6023b1d..3ad5a14 100644 --- a/src/components/BottomSheetWithSearchInput.tsx +++ b/src/components/BottomSheetWithSearchInput.tsx @@ -150,6 +150,7 @@ const BottomSheetWithSearchInput = ({ animationConfigs={animationConfigs} snapPoints={['80%']} enableDynamicSizing={false} + bottomInset={insets.bottom} handleIndicatorStyle={bottomSheetStyles.handleIndicator} handleStyle={[bottomSheetStyles.handle, { backgroundColor: colors.card }]} keyboardBehavior="extend" @@ -161,7 +162,7 @@ const BottomSheetWithSearchInput = ({ ItemSeparatorComponent={Separator} keyboardDismissMode="on-drag" keyboardShouldPersistTaps="handled" - contentContainerStyle={{ paddingBottom: insets.bottom, backgroundColor: colors.card }} + contentContainerStyle={{ backgroundColor: colors.card }} ListHeaderComponent={listHeader} stickyHeaderIndices={[0]} renderItem={({ item }) => ( diff --git a/src/components/__tests__/BottomSheetWithSearchInput.test.tsx b/src/components/__tests__/BottomSheetWithSearchInput.test.tsx index 6b3fc9e..c3fbe36 100644 --- a/src/components/__tests__/BottomSheetWithSearchInput.test.tsx +++ b/src/components/__tests__/BottomSheetWithSearchInput.test.tsx @@ -1,9 +1,11 @@ import React from 'react' import { Keyboard } from 'react-native' +import BottomSheet from '@gorhom/bottom-sheet' import { describe, expect, jest, test } from '@jest/globals' import { NavigationContainer } from '@react-navigation/native' import { fireEvent, render } from '@testing-library/react-native' +import { SafeAreaProvider } from 'react-native-safe-area-context' import BottomSheetWithSearchInput from '../BottomSheetWithSearchInput' @@ -43,6 +45,34 @@ describe('BottomSheetWithSearchInput', () => { const { toJSON } = renderComponent({ selectedKey: 'nl' }) expect(toJSON()).toMatchSnapshot() }) + + test('Passes the safe area bottom inset to the bottom sheet when insets are present', () => { + const { UNSAFE_getByType } = render( + + + + + , + ) + + expect(UNSAFE_getByType(BottomSheet).props.bottomInset).toBe(34) + }) }) describe('Interaction', () => { diff --git a/src/components/__tests__/__snapshots__/BottomSheetWithSearchInput.test.tsx.snap b/src/components/__tests__/__snapshots__/BottomSheetWithSearchInput.test.tsx.snap index 8d0eea8..6c5e8f2 100644 --- a/src/components/__tests__/__snapshots__/BottomSheetWithSearchInput.test.tsx.snap +++ b/src/components/__tests__/__snapshots__/BottomSheetWithSearchInput.test.tsx.snap @@ -78,7 +78,6 @@ exports[`BottomSheetWithSearchInput Rendering Initial state 1`] = ` contentContainerStyle={ { "backgroundColor": "rgb(255, 255, 255)", - "paddingBottom": 0, } } data={ @@ -682,7 +681,6 @@ exports[`BottomSheetWithSearchInput Rendering With selected item 1`] = ` contentContainerStyle={ { "backgroundColor": "rgb(255, 255, 255)", - "paddingBottom": 0, } } data={