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

How to configure gift-chat to send message when enter key is pressed? #21

Open
iswetak opened this issue Apr 28, 2020 · 1 comment
Open

Comments

@iswetak
Copy link

iswetak commented Apr 28, 2020

Issue Description

[FILL THIS OUT]

Steps to Reproduce / Code Snippets

[FILL THIS OUT]

Expected Results

[FILL THIS OUT]

Additional Information

  • Nodejs version: [FILL THIS OUT]
  • React version: [FILL THIS OUT]
  • react-web-gifted-chat version: [FILL THIS OUT]
  • Browser(s) (Chrome, etc.): [FILL THIS OUT]
@9paradox
Copy link

9paradox commented May 9, 2020

its already available 'onSend'

constructor(props) {
  //init stuff
  this.onSend = this.onSend.bind(this); //bind the function
}

onSend(message) {
  if(message && message[0] && message[0].text){
     //send msg to server
  }
}

render() { 
  return ( 
  <GiftedChat
    ..other props.. 
    onSend={this.onSend}/>
  );
}

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