Andr3wHur5t / react-native-keyboard-spacer

Plug and play react-native keyboard spacer view.
MIT License
1.56k stars 219 forks source link

double press on button when need to submit TextInput value need single click #67

Open ignivahermenpreet opened 6 years ago

ignivahermenpreet commented 6 years ago

when i click on send messege button then it's working on double press on button .first button hide the keyboard and second send the text from text field. how i can send it on single click. this is my source code.

<ScrollView style={{backgroundColor: '#F4F4F4'}} onScroll={this.scroll}> {data}

            <View style={{backgroundColor:"#F4F4F4",flexDirection: 'row',paddingLeft:5,paddingBottom:5,height:SCREEN_HEIGHT*7/100}}>
              <TextInput 
                multiline={true}
                defaultValue={this.state.post}
                returnKeyType='done'
                maxLength={500} 
                onChangeText={(post) => {this.setState({post});}}
                style={{backgroundColor: '#ffffff',
                  marginTop: 5,
                  paddingLeft: 15,
                  paddingRight: 15,
                  marginLeft:screen.width/100*3, 
                  width:screen.width/100*78,
                  fontSize:screen.width/100*4,
                  color:'gray'}} 
                placeholderTextColor="gray"
                onSubmitEditing={(event) => this.postComment()} 
                placeholder='Write a comment'/>
                <TouchableOpacity onPress={()=>{this.postComment()}}>
                  <Thumbnail square style={{marginLeft:8,marginTop:8,width:screen.width/100*7,height:screen.height/100*4}} source={send}/>
                </TouchableOpacity>
            </View>
          <KeyboardSpacer/>
wachunei commented 6 years ago

Use ScrollView keyboardShouldPersistTaps prop.