Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ignivahermenpreet opened this issue Nov 29, 2017 · 1 comment

Comments

@ignivahermenpreet
Copy link

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
Copy link

wachunei commented Feb 8, 2018

Use ScrollView keyboardShouldPersistTaps prop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants