summaryrefslogtreecommitdiffstats
path: root/webapp/components/textbox.jsx
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-07-15 10:37:51 -0400
committerJoram Wilander <jwawilander@gmail.com>2016-07-15 10:37:51 -0400
commit500b2dce10d396a53c11596d35ef63688ada0861 (patch)
treef00af325165a3cbdcf24f84218cb93c6c38733f1 /webapp/components/textbox.jsx
parent47535ed0c7b8155fb7cdcb3cf226fb9cc57bc542 (diff)
downloadchat-500b2dce10d396a53c11596d35ef63688ada0861.tar.gz
chat-500b2dce10d396a53c11596d35ef63688ada0861.tar.bz2
chat-500b2dce10d396a53c11596d35ef63688ada0861.zip
Fixed input handlers used by Textbox and SuggestionBox components to properly update when typing quickly (#3598)
Diffstat (limited to 'webapp/components/textbox.jsx')
-rw-r--r--webapp/components/textbox.jsx14
1 files changed, 4 insertions, 10 deletions
diff --git a/webapp/components/textbox.jsx b/webapp/components/textbox.jsx
index 40e6aec4a..24f58f43e 100644
--- a/webapp/components/textbox.jsx
+++ b/webapp/components/textbox.jsx
@@ -176,11 +176,6 @@ export default class Textbox extends React.Component {
</div>
);
- const otherProps = {};
- if (!this.props.typing) {
- otherProps.value = this.props.messageText;
- }
-
return (
<div
ref='wrapper'
@@ -194,7 +189,7 @@ export default class Textbox extends React.Component {
spellCheck='true'
maxLength={Constants.MAX_POST_LEN}
placeholder={this.props.createMessage}
- onUserInput={this.props.onUserInput}
+ onInput={this.props.onInput}
onKeyPress={this.handleKeyPress}
onKeyDown={this.handleKeyDown}
onHeightChange={this.handleHeightChange}
@@ -202,7 +197,7 @@ export default class Textbox extends React.Component {
listComponent={SuggestionList}
providers={this.suggestionProviders}
channelId={this.props.channelId}
- {...otherProps}
+ value={this.props.messageText}
/>
<div
ref='preview'
@@ -239,10 +234,9 @@ Textbox.propTypes = {
id: React.PropTypes.string.isRequired,
channelId: React.PropTypes.string,
messageText: React.PropTypes.string.isRequired,
- onUserInput: React.PropTypes.func.isRequired,
+ onInput: React.PropTypes.func.isRequired,
onKeyPress: React.PropTypes.func.isRequired,
createMessage: React.PropTypes.string.isRequired,
onKeyDown: React.PropTypes.func,
- supportsCommands: React.PropTypes.bool.isRequired,
- typing: React.PropTypes.bool.isRequired
+ supportsCommands: React.PropTypes.bool.isRequired
};