Skip to content

Commit

Permalink
Merge pull request facebook#70 from johanhelsing/f_removenewlineincha…
Browse files Browse the repository at this point in the history
…texample

Fix newline appearing in textarea in ChatApp
  • Loading branch information
fisherwebdev committed Oct 4, 2014
2 parents 81a4fc3 + 3ffb2ee commit 6c1016e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions examples/flux-chat/js/components/MessageComposer.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ var MessageComposer = React.createClass({

_onKeyDown: function(event) {
if (event.keyCode === ENTER_KEY_CODE) {
event.preventDefault();
var text = this.state.text.trim();
if (text) {
ChatMessageActionCreators.createMessage(text);
Expand Down

0 comments on commit 6c1016e

Please sign in to comment.