react-native-actions-sheet icon indicating copy to clipboard operation
react-native-actions-sheet copied to clipboard

On android the action sheet will grow out of view when a text input is focused.

Open ac3kb opened this issue 1 year ago • 12 comments

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

ac3kb avatar Nov 24 '24 17:11 ac3kb

I'm having the same issue (Expo 52)

mehamednews avatar Nov 25 '24 11:11 mehamednews

I am also having the same issue.

OdebisiidowuSolomon avatar Nov 30 '24 07:11 OdebisiidowuSolomon

I am also having the same issue !!

ersaky avatar Nov 30 '24 09:11 ersaky

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 !

ersaky avatar Nov 30 '24 09:11 ersaky

Same issue only on android

https://github.com/user-attachments/assets/f9b97734-f143-4902-9361-264958dcc272

Yaya12085 avatar Dec 03 '24 14:12 Yaya12085

Upgrading to the latest version of React Native (0.76.5) seemed to resolve this issue on my end.

coreyphillips avatar Dec 16 '24 21:12 coreyphillips

Already on React Native (0.76.5) and I have everything set as ersaky described.

Did anyone find a solution?

sedrakk avatar Jan 24 '25 18:01 sedrakk

actually adding keyboardHandlerEnabled={false} per this comment generally solved the issue

sedrakk avatar Jan 24 '25 19:01 sedrakk

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.

erkanarslan avatar Feb 03 '25 03:02 erkanarslan

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 ScrollView from ActionSheetContent prevents the issue
  • Disabling keyboardHandlerEnabled also 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

AjayParambath avatar Mar 13 '25 08:03 AjayParambath

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'}

noumantahir avatar Mar 18 '25 12:03 noumantahir

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

Domenico-Esposito avatar Mar 29 '25 21:03 Domenico-Esposito

@ersaky Thank you! You saved my day!

hipetech avatar Aug 15 '25 17:08 hipetech