Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

141
Views
Keyboard avoid text Input does not work properly - React Native

I'm trying to place an input on bottom of the screen and when I click, I want it to be above the keyboard. I'm using Expo. I have tried two scenarios:

  1. Without "softwareKeyboardLayoutMode": "pan" configuration in app.json file. In this approach it works fine expect it shifts the bottom tab bar above keyboard as well, so it does not work for me. For that I have tried the
screenOptions={{
                tabBarHideOnKeyboard: 'true'
            }}

configuration in tab bar but it does not work smoothly and it also will not work if I try to add custom component for the bottom tab bar.

  1. With "softwareKeyboardLayoutMode": "pan". With this approach the bottom tab bar is hidden and it eventually kind of works but behaves strangely. When I focus on the text input, it opens keyboard, shifts the input too much above and then returns it back to right above the keyboard (to where it should be). I have tried some changes on my code but could not end up with any solution. Please, try the code, and you'll see.

Here is my code:

NewComp.js:

const NewComp = () => {
    return (
        <KeyboardAvoidingView
            behavior={"height"}
            style={{ flex: 1 }}
        >
            <TouchableWithoutFeedback onPress={Keyboard.dismiss}>
                <View style={{
                    padding: 24,
                    flex: 1,
                    justifyContent: "flex-end"
                }}>
                    <TextInput placeholder="Username" style={{
                        height: 40,
                        borderColor: "#000000",
                        borderBottomWidth: 1,
                    }}/>
                </View>
            </TouchableWithoutFeedback>
        </KeyboardAvoidingView>
    );
};

BottomNavigator.js:

const BottomNavigator = ({ navigation, route }) => {

   return (
       <Tab.Navigator>
           <Tab.Screen key={1} name={'TAB_1'} component={NewComp} options={{header: () => null}}/>
           <Tab.Screen key={2} name={'TAB_2'} component={NewComp} options={{header: () => null}} />
           <Tab.Screen key={3} name={'TAB_3'} component={NewComp} options={{header: () => null}} />
       </Tab.Navigator>
   );
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

have you tried this doc KeyboardAvoidingView ? I can set whether the position of the content will be above the keyboard or behind.

if you want to display, send props enabled={true} this is the default value. if you want to hide, send props enabled={false}

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!