react-native-gifted-chat icon indicating copy to clipboard operation
react-native-gifted-chat copied to clipboard

Keyboard covers text input on android only

Open jtweaver opened this issue 2 years ago • 11 comments

Issue Description

The keyboard covers the text input on android only. It doesn't look like the content moves at all. My configuration is essentially the default, and while I do use react-navigation, this page has neither tabs nor a top header.

I've been through all of the other issues on this repo concerning what seems to be the same issue here and tried all of them to no avail on android (iOS works fine, even when I do add a header or bottom tabs).

Steps to Reproduce / Code Snippets

<View style={{ flex: 1 }}>
<GiftedChat
          messages={messages}
          onSend={sendMessage}
          user={{
            _id: -1,
          }}
/>
</View>

Expected Results

The text input (and the existing messages) to slide up above the keyboard.

Additional Information

  • Nodejs version: v16.13.0
  • React version: 17.0.2
  • React Native version: 0.68.2

https://user-images.githubusercontent.com/19966086/179897620-9637ad3f-b338-48db-8d23-d91409151836.mov

  • react-native-gifted-chat version: 1.0.4
  • Platform(s) (iOS, Android, or both?): Android
  • TypeScript version: N/A

jtweaver avatar Jul 20 '22 04:07 jtweaver

You can try https://stackoverflow.com/questions/3295672/android-soft-keyboard-covers-edittext-field

huuthinh95 avatar Jul 21 '22 11:07 huuthinh95

Hello, got the same issue, did you manage to find any solutions?

chunghn avatar Aug 08 '22 07:08 chunghn

Hello, getting same issue in android device, did anyone find any solution?

PR-Here avatar Aug 21 '22 09:08 PR-Here

The linked SO by @huuthinh95 was the solution:

android:windowSoftInputMode="adjustPan"

jtweaver avatar Aug 21 '22 20:08 jtweaver

Hello, got the same issue, did you manage to find any solutions?

android:windowSoftInputMode="adjustPan" Just add this in your Manifest file.

PR-Here avatar Aug 31 '22 14:08 PR-Here

Hello, got the same issue, did you manage to find any solutions?

android:windowSoftInputMode="adjustPan" Just add this in your Manifest file.

Thanks! However I got another issue. The keyboard is overlapping the textinput. I have tried bottomOffset and minInputToolbarHeight but seems no luck.

keyboardIssue

chunghn avatar Sep 01 '22 07:09 chunghn

just calculate how diff from your input height with example input height, then give it to bottom offset

fukemy avatar Sep 26 '22 07:09 fukemy

for example, example input height is 44, your height is 50, so give bottomOffset = 6

fukemy avatar Sep 26 '22 07:09 fukemy

There is no effect of bottomOffset if windowSoftInputMode="adjustPan"

Turns out I just use the default value, 'resize', and figured out these value for the Offset (I'm using expo)

bottomOffset={Platform.OS === "ios" ? 10 : 0}
minInputToolbarHeight={Platform.OS == "android" ? 48 : 40}

chunghn avatar Sep 27 '22 04:09 chunghn

Hi, I m facing the same issue, but not in react native, I m testing my web app on different devices using browserstack, and on android devices, when i use to add comment, keyboard overlaps the text field, How can I fix this issue in react js image

abdurrehmaan avatar Jan 08 '23 06:01 abdurrehmaan

@abdurrehmaan Hey, have you got any leads on this issue?

I am also facing a similar issue in react-native-web, It would be really helpful if you got any solution regarding this.

Prasannsitani avatar Apr 03 '23 09:04 Prasannsitani