question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Header gets pushed up on Android when keyboard first appears

See original GitHub issue

Issue Description

I’m using react-native-keyboard-aware-scroll-view so have to set windowSoftInputMode to adjustPan. So I adopted the method of using KeyboardAvoidingView as described in the readme. Here is my code for the screen:

      <View style={styles.container}>
        <Header
          title={selectedConversation.conversation_name}
          onGoBack={this.onGoBack}
        />
        <GiftedChat
          messages={this.getMappedMessages()}
          onSend={this.onSend}
          user={this.getUser()}
          inverted={false}
          loadEarlier={!isFetchCompleted(conversationsFetchState)}
          isLoadingEarlier={!isFetchCompleted(conversationsFetchState)}
          renderLoadEarlier={() => (
            <View style={styles.activityIndicatorContainer}>
              <ActivityIndicator size="large" color={colors.gray} />
            </View>
          )}
        />
        {Platform.OS === 'android' && (
          <KeyboardAvoidingView behavior="padding" />
        )}
      </View>

However, the header gets pushed up when the keyboard first appears, but as soon as I type it displays normally again.

Here is a screen recording:

ezgif com-gif-maker

How can I fix this?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:13
  • Comments:6

github_iconTop GitHub Comments

5reactions
JuulCrooymanscommented, Nov 20, 2020

For people that are using expo. I fixed it by changing "softwareKeyboardLayoutMode": "pan" to "softwareKeyboardLayoutMode": "resize" in app.json

2reactions
mehimanshupatilcommented, Jan 29, 2021

Has any one found fix for this

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why keyboard is pushing up may layout and vanishing my ...
I am making a chat application, but happens what when edit text gets focused mean keyboard comes up it hides my header and...
Read more >
How to make your React Native app respond gracefully when ...
The image at the top gets pushed out of the view when using this simple implementation. I'll show you how you can fix...
Read more >
KeyboardAvoidingView - React Native
KeyboardAvoidingView. This component will automatically adjust its height, position, or bottom padding based on the keyboard height to ...
Read more >
How to push a view up to avoid the keyboard | RNcasts #7
The virtual keyboard obscuring an input is a common issue in mobile apps. In this episode, I show how to solve this issue...
Read more >
A Keyboard Avoiding View for React Native in 2021
A Copy-and-Paste Solution that Supports all iOS and Android keyboards!. Tagged with typescript, react, native, hook.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found