Skip to content

Commit

Permalink
interesting bug... issue when using traditional chinese IME need to p…
Browse files Browse the repository at this point in the history
…ress enter twice (#267)
  • Loading branch information
alvita authored Jun 26, 2017
1 parent b283aaa commit f92b8a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/ComposeTextPanel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class ComposeTextPanel extends Component {
};

this.onTextAreaKeyDown = (e) => {
console.debug('onTextAreaKeyDown', e);
if (e.key === 'Enter') {
e.preventDefault();
this.props.send();
Expand Down Expand Up @@ -153,7 +154,7 @@ class ComposeTextPanel extends Component {
value={this.props.messageText}
maxLength="1000"
onChange={this.onTextChange}
onKeyDown={this.onTextAreaKeyDown}
onKeyPressCapture={this.onTextAreaKeyDown}
/>
</div>
<div className={styles.submitField}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ConversationPanel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class ConversationPanel extends Component {
value={this.state.textValue}
maxLength="1000"
onChange={this.onTextChange}
onKeyDown={this.onTextAreaKeyDown}
onKeyPressCapture={this.onTextAreaKeyDown}
/>
</div>
<div className={styles.submitField}>
Expand Down

0 comments on commit f92b8a4

Please sign in to comment.