diff options
author | enahum <nahumhbl@gmail.com> | 2016-09-07 09:02:24 -0300 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-09-07 08:02:24 -0400 |
commit | c99db74390e98157acbee17e8286142eebbfe0f7 (patch) | |
tree | ff9e92ee490536e4f21208ce5d5f9ab232b21bfb /webapp/components/textbox.jsx | |
parent | dde7b50adfbe7023459c41c1ade874338da27f26 (diff) | |
download | chat-c99db74390e98157acbee17e8286142eebbfe0f7.tar.gz chat-c99db74390e98157acbee17e8286142eebbfe0f7.tar.bz2 chat-c99db74390e98157acbee17e8286142eebbfe0f7.zip |
PLT-4084 Fix Unable to send messages in RC (#3983)
Diffstat (limited to 'webapp/components/textbox.jsx')
-rw-r--r-- | webapp/components/textbox.jsx | 13 |
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 }; |