My react-native TextInput disappear when I start typing

918 views Asked by At

I have screen named EditScreen. It has text input that takes the height of the device. The problem is that when I start typing the text goes above and disappear. Any solutions, please.

here is my Text Input component

 <View style={styles.InputContainer}>
      <ScrollView>
        <TextInput
          style={styles.inputText}
          placeholder={"Take Notes ..."}
          onChangeText={HandlingTextValut}
          value={notes}
          multiline={true}
        />
      </ScrollView>
    </View>

// and here is its styles
InputContainer: {
    flex:1,
  },
  inputText: {
    paddingBottom: Dimensions.get("window").height- 100,
    paddingLeft: 10,
    paddingRight: 10,
    fontSize: 20,
  },
2

There are 2 answers

0
Václav Ryska On

remove paddingBottom: Dimensions.get("window").height- 100, from input style

0
Dipan Sharma On

can you please try these props numberOfLines and onContentSizeChange .

Reference link : https://reactnative.dev/docs/textinput#numberoflines