Skip to content

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

@ignivahermenpreet

Description

@ignivahermenpreet

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/>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions