TextInput weird behaviour in React-Native

前端 未结 2 1182
遥遥无期
遥遥无期 2021-01-22 09:37

I have the following TextInput,



        
相关标签:
2条回答
  • 2021-01-22 09:52

    Maybe try this:

    import DismissKeyboard from 'dismissKeyboard';
    <TouchableWithoutFeedback onPress={()=>{DismissKeyboard()}}>
        <View style={Styles.container}>
           <TextInput />
        </View>
     </TouchableWithoutFeedback>
    
    0 讨论(0)
  • 2021-01-22 10:04

    This is because of scroll view. Add props keyboardShouldPersistTaps in your scrollview as below to solve error :

    <ScrollView
        keyboardShouldPersistTaps="handled"
        keyboardDismissMode="interactive"
    >
    
    ...
    ...
    
    </ScrollView>
    

    You can find more detail here

    0 讨论(0)
提交回复
热议问题