keyboardBehavior="interactive" doesn't work
Bug
Hi!
I try to use feature keyboardBehavior="interactive", but it doesn't work, possibly because of:
https://github.com/gorhom/react-native-bottom-sheet/blob/7c6d9f3fb601a092f0e7b4752ac608c40c47c60a/src/hooks/useKeyboard.ts#L31
Environment info
| Library | Version |
|---|---|
| @gorhom/bottom-sheet | 3.6.3 |
| react-native | 0.64.0 |
| react-native-reanimated | 2.1.0 |
| react-native-gesture-handler | 1.10.3 |
Steps To Reproduce
Set up keyboardBehavior="interactive"
Describe what you expected to happen:
from
to

But its hide behind keyboard
Reproducible sample code
<BottomSheetModalProvider>
<BottomSheetModal
ref={bottomSheetModalRef}
keyboardBehavior="interactive"
keyboardBlurBehavior="restore"
index={0}
snapPoints={snapPoints}
backdropComponent={BottomSheetBackdrop}
onChange={handleSheetChanges}
>
<TextInputComponent>
</TextInputComponent>
</BottomSheetModal>
</BottomSheetModalProvider>
I'm seeing the same thing with keyboardBehavior="fullScreen" - nothing happens when the keyboard is shown. Changing the referenced line to const shouldHandleKeyboardEvents = useSharedValue(true); causes the keyboard handling to match what is described in the documentation.
It seems like the intention may have been for BottomSheet to set shouldHandleKeyboardEvents.value = true when keyboardBehavior !== KEYBOARD_BEHAVIOR.none?
You have to use BottomSheetTextInput
You have to use BottomSheetTextInput
Thanks - I can confirm that works for the TextInput use case, though my use case is a focus-able WebView in the modal. It looks like there isn't a way to access useBottomSheetInternal in external code - so perhaps a more generic focusable component would be useful?
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.
@onmotion I'm facing same issue. Have you found any solution.