Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

Keyboard keeps closing after user taps on input

$
0
0

The problems =>https://drive.google.com/open?id=1KwBWMVsj-0PFzt9cLfLuZ9cTvkqjIob8

This is my code

export default function TextInp(props) {
  const [ansVal, setAnsVal] = useState(props.data.ans);

  const answer = (ans) => {
    setAnsVal(ans);
    props.answer(ans);
  };

  return (
    <View style={styles.view}>
      <TextInput
        placeholder={props.placeholder}
        style={props.free ? styles.freeContainer : styles.container}
        onChangeText={(text)=>answer(text)}
        defaultValue={ansVal}
      />
    </View>
  );
}

PS. the TextInput is inside ScrollView. I'm not sure if this is the cause of the problem.


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>