summaryrefslogtreecommitdiffstats
path: root/webapp/components/textbox.jsx
diff options
context:
space:
mode:
authorElias Nahum <nahumhbl@gmail.com>2016-09-07 01:12:27 -0300
committerElias Nahum <nahumhbl@gmail.com>2016-09-07 01:12:27 -0300
commita5ebbcfdb4f151de204b6be276c5f07175ceb82a (patch)
treeff9e92ee490536e4f21208ce5d5f9ab232b21bfb /webapp/components/textbox.jsx
parentdde7b50adfbe7023459c41c1ade874338da27f26 (diff)
downloadchat-a5ebbcfdb4f151de204b6be276c5f07175ceb82a.tar.gz
chat-a5ebbcfdb4f151de204b6be276c5f07175ceb82a.tar.bz2
chat-a5ebbcfdb4f151de204b6be276c5f07175ceb82a.zip
PLT-4084 Fix Unable to send messages in RC
Diffstat (limited to 'webapp/components/textbox.jsx')
-rw-r--r--webapp/components/textbox.jsx13
1 files changed, 11 insertions, 2 deletions
diff --git a/webapp/components/textbox.jsx b/webapp/components/textbox.jsx
index 791513b88..fac1bd027 100644
--- a/webapp/components/textbox.jsx
+++ b/webapp/components/textbox.jsx
@@ -26,6 +26,7 @@ export default class Textbox extends React.Component {
this.focus = this.focus.bind(this);
this.getStateFromStores = this.getStateFromStores.bind(this);
this.onRecievedError = this.onRecievedError.bind(this);
+ this.handleKeyPress = this.handleKeyPress.bind(this);
this.handleKeyDown = this.handleKeyDown.bind(this);
this.handleHeightChange = this.handleHeightChange.bind(this);
this.showPreview = this.showPreview.bind(this);
@@ -68,8 +69,14 @@ export default class Textbox extends React.Component {
}
}
+ handleKeyPress(e) {
+ this.props.onKeyPress(e);
+ }
+
handleKeyDown(e) {
- this.props.onKeyDown(e);
+ if (this.props.onKeyDown) {
+ this.props.onKeyDown(e);
+ }
}
handleHeightChange(height) {
@@ -183,6 +190,7 @@ export default class Textbox extends React.Component {
maxLength={Constants.MAX_POST_LEN}
placeholder={this.props.createMessage}
onInput={this.props.onInput}
+ onKeyPress={this.handleKeyPress}
onKeyDown={this.handleKeyDown}
onHeightChange={this.handleHeightChange}
style={{visibility: this.state.preview ? 'hidden' : 'visible'}}
@@ -227,7 +235,8 @@ Textbox.propTypes = {
channelId: React.PropTypes.string,
messageText: React.PropTypes.string.isRequired,
onInput: React.PropTypes.func.isRequired,
+ onKeyPress: React.PropTypes.func.isRequired,
createMessage: React.PropTypes.string.isRequired,
- onKeyDown: React.PropTypes.func.isRequired,
+ onKeyDown: React.PropTypes.func,
supportsCommands: React.PropTypes.bool.isRequired
};