summaryrefslogtreecommitdiffstats
path: root/webapp/components/textbox.jsx
diff options
context:
space:
mode:
authorenahum <nahumhbl@gmail.com>2016-09-06 18:39:46 -0300
committerJoram Wilander <jwawilander@gmail.com>2016-09-06 17:39:46 -0400
commit024a72b440345709692d46f2b15d5cb958926359 (patch)
tree2915201ed864dac3ff6cbeb0db8efb17c5acf6b8 /webapp/components/textbox.jsx
parent0ace02df0861ef701f31c221a1ffb8cf7bfb2d35 (diff)
downloadchat-024a72b440345709692d46f2b15d5cb958926359.tar.gz
chat-024a72b440345709692d46f2b15d5cb958926359.tar.bz2
chat-024a72b440345709692d46f2b15d5cb958926359.zip
PLT-4025 fixed so Ctrl+Enter works on windows (#3979)
Diffstat (limited to 'webapp/components/textbox.jsx')
-rw-r--r--webapp/components/textbox.jsx13
1 files changed, 2 insertions, 11 deletions
diff --git a/webapp/components/textbox.jsx b/webapp/components/textbox.jsx
index fac1bd027..791513b88 100644
--- a/webapp/components/textbox.jsx
+++ b/webapp/components/textbox.jsx
@@ -26,7 +26,6 @@ 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);
@@ -69,14 +68,8 @@ export default class Textbox extends React.Component {
}
}
- handleKeyPress(e) {
- this.props.onKeyPress(e);
- }
-
handleKeyDown(e) {
- if (this.props.onKeyDown) {
- this.props.onKeyDown(e);
- }
+ this.props.onKeyDown(e);
}
handleHeightChange(height) {
@@ -190,7 +183,6 @@ 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'}}
@@ -235,8 +227,7 @@ 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,
+ onKeyDown: React.PropTypes.func.isRequired,
supportsCommands: React.PropTypes.bool.isRequired
};