0

(I'm testing on Android if it matters)

I'm using the component KeyboardAwareScrollView to make the inputs visible while the soft keyboard is open. I have two inputs, one below the other, and when I press the top one, the soft keyboard does make sure it's visible but also hides the one below.

Is there a way to make sure that when the keyboard is open, the two inputs will remain visible, even if the user pressed the one at the top?

My code:

<KeyboardAwareScrollView scrollEnabled={false} resetScrollToCoords={{ x: 0, y: 0 }}>

  <Image {...this.image.header} style={{ height: 400, width: '100%' }} />

  <View>
    <TextInput style={{ backgroundColor: 'red' }} />
    <TextInput style={{ backgroundColor: 'blue' }} />
  </View>

</KeyboardAwareScrollView>
Rajan
  • 1,512
  • 2
  • 14
  • 18
sir-haver
  • 3,096
  • 7
  • 41
  • 85

1 Answers1

0

I am copying this answer of boredgames.

<TextInput
    placeholder = "FirstTextInput"
    returnKeyType = { "next" }
    onSubmitEditing={() => { this.secondTextInput.focus(); }}
    blurOnSubmit={false}
/>

<TextInput
    ref={(input) => { this.secondTextInput = input; }}
    placeholder = "secondTextInput"
/>
Tushar Pandey
  • 4,557
  • 4
  • 33
  • 50
  • Thanks but this has nothing to do with my question, I want the two inputs to be visible, even when the first input is pressed – sir-haver May 12 '20 at 07:58