react-native-actions-sheet
react-native-actions-sheet copied to clipboard
On android the action sheet will grow out of view when a text input is focused.
Expo version 52 react native version 0.76.3 react-native-actions-sheet version 0.9.7 react-native-gesture-handler 2.20.2
works fine on expo version 51
example app https://snack.expo.dev/@ac3kmb/93ca10
I'm having the same issue (Expo 52)
I am also having the same issue.
I am also having the same issue !!
I am also having the same issue !!
use <GestureHandlerRootView> in your root file (app.js or index.js etc.) imported from 'react-native-gesture-handler'
<GestureHandlerRootView> <SheetProvider> .... </SheetProvider> </GestureHandlerRootView>
then add isModal={false} prop to your <ActionSheet> component. it works !
Same issue only on android
https://github.com/user-attachments/assets/f9b97734-f143-4902-9361-264958dcc272
Upgrading to the latest version of React Native (0.76.5) seemed to resolve this issue on my end.
Already on React Native (0.76.5) and I have everything set as ersaky described.
Did anyone find a solution?
actually adding keyboardHandlerEnabled={false} per this comment generally solved the issue
React Native (0.76.5) and keyboardHandlerEnabled={false} solved the issue for me but when the keyboard is open, sheet gets hidden and visible again.
https://github.com/ammarahm-ed/react-native-actions-sheet/issues/224
Setting keyboardHandlerEnabled to false resolved the issue:
<ActionSheet keyboardHandlerEnabled={false}>
...
</ActionSheet>
Alternatively, removing the ScrollView inside the ActionSheet can also fix the problem:
<ActionSheet >
<!-- Remove ScrollView -->
<View>
<TextInput ... />
</View>
</ActionSheet>
Issue Description
The issue occurs only on Android devices when using a TextInput inside a ScrollView within ActionSheetContent. This does not happen on iOS because adding SafeAreaProvider and SafeAreaView resolves it there.
- Removing the
ScrollViewfromActionSheetContentprevents the issue - Disabling
keyboardHandlerEnabledalso fixes the issue
Setup Details
- React Native (latest version) + Expo
- Issue occurs on both device and simulator
- GestureHandlerRootView, and SheetProvider have been added in
App.jsx
actually adding
keyboardHandlerEnabled={false}per this comment generally solved the issue
This hack seems to resolve the issue on android, but on ios it creates and issue, ended up using platform specific flag
keyboardHandlerEnabled={Platform.OS !== 'android'}
I believe the issue is related to the handleKeyboardDidShow handler inside the useKeyboard hook. Specifically, the keyboard height returned in the event seems to be incorrect on Android.
https://github.com/ammarahm-ed/react-native-actions-sheet/blob/5bf7f5a4269c990fa631d35fe2400dc3458ab9e8/src/hooks/useKeyboard.ts#L38
In my case, I had to use android:windowSoftInputMode="adjustPan" in the AndroidManifest.xml.
For those using Expo:
{
"android": {
"softwareKeyboardLayoutMode": "pan"
}
}
https://github.com/facebook/react-native/issues/10990#issuecomment-345953100
@ersaky Thank you! You saved my day!