[Sheets] [Pt. 13] Keyboard handling (#5586)

Co-authored-by: Eric Bailey <git@esb.lol>
Co-authored-by: Samuel Newman <mozzius@protonmail.com>
This commit is contained in:
Hailey
2024-10-02 21:53:23 -07:00
committed by GitHub
parent 14e3567663
commit 52a8e4d616
8 changed files with 11 additions and 53 deletions
+6 -3
View File
@@ -1,6 +1,7 @@
import React, {useImperativeHandle} from 'react'
import {StyleProp, TextInput, View, ViewStyle} from 'react-native'
import {GestureHandlerRootView, ScrollView} from 'react-native-gesture-handler'
import {KeyboardAwareScrollView} from 'react-native-keyboard-controller'
import {useSafeAreaInsets} from 'react-native-safe-area-context'
import {logger} from '#/logger'
@@ -162,13 +163,15 @@ export const ScrollableInner = React.forwardRef<ScrollView, DialogInnerProps>(
const insets = useSafeAreaInsets()
const {nativeSnapPoint} = useDialogContext()
return (
<ScrollView
<KeyboardAwareScrollView
style={[a.px_xl, style]}
ref={ref}
bounces={nativeSnapPoint === BottomSheetSnapPoint.Full}>
bounces={nativeSnapPoint === BottomSheetSnapPoint.Full}
bottomOffset={30}
ScrollViewComponent={ScrollView}>
{children}
<View style={{height: insets.bottom + a.pt_5xl.paddingTop}} />
</ScrollView>
</KeyboardAwareScrollView>
)
},
)