From 3ffb2ee3fb85f5765137489a3180528b22debe04 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Wed, 1 Oct 2014 12:26:39 +0200 Subject: [PATCH] Fix newline appearing in textarea in ChatApp Call event.preventDefault() to stop a newline being added to the textarea in the MessageComposer component. --- examples/flux-chat/js/components/MessageComposer.react.js | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/flux-chat/js/components/MessageComposer.react.js b/examples/flux-chat/js/components/MessageComposer.react.js index b8ffce4006e0c4..9acbe747cf40db 100644 --- a/examples/flux-chat/js/components/MessageComposer.react.js +++ b/examples/flux-chat/js/components/MessageComposer.react.js @@ -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);