diff options
author | enahum <nahumhbl@gmail.com> | 2016-06-06 15:54:02 -0300 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-06-06 14:54:02 -0400 |
commit | 65f51c7bc4bb0b85532a23171306ba7d331c2fd9 (patch) | |
tree | c3c5bb661dd962447c198bb3f8c54b2a3f47d413 /webapp/components/edit_post_modal.jsx | |
parent | c0d1b8fbb9a141b942d73ad4869e612cdf01bbcd (diff) | |
download | chat-65f51c7bc4bb0b85532a23171306ba7d331c2fd9.tar.gz chat-65f51c7bc4bb0b85532a23171306ba7d331c2fd9.tar.bz2 chat-65f51c7bc4bb0b85532a23171306ba7d331c2fd9.zip |
PLT-3056 Fix Unable to type quickly in post textbox in IE11 (#3249)
Diffstat (limited to 'webapp/components/edit_post_modal.jsx')
-rw-r--r-- | webapp/components/edit_post_modal.jsx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/webapp/components/edit_post_modal.jsx b/webapp/components/edit_post_modal.jsx index 0c7b8d672..4bd23a26d 100644 --- a/webapp/components/edit_post_modal.jsx +++ b/webapp/components/edit_post_modal.jsx @@ -38,7 +38,7 @@ class EditPostModal extends React.Component { this.handleKeyDown = this.handleKeyDown.bind(this); this.onPreferenceChange = this.onPreferenceChange.bind(this); - this.state = {editText: '', originalText: '', title: '', post_id: '', channel_id: '', comments: 0, refocusId: ''}; + this.state = {editText: '', originalText: '', title: '', post_id: '', channel_id: '', comments: 0, refocusId: '', typing: false}; } handleEdit() { var updatedPost = {}; @@ -78,7 +78,8 @@ class EditPostModal extends React.Component { $('#edit_post').modal('hide'); } handleEditInput(editMessage) { - this.setState({editText: editMessage}); + const typing = editMessage !== ''; + this.setState({editText: editMessage, typing}); } handleEditKeyPress(e) { if (!this.state.ctrlSend && e.which === KeyCodes.ENTER && !e.shiftKey && !e.altKey) { @@ -99,7 +100,8 @@ class EditPostModal extends React.Component { post_id: options.postId || '', channel_id: options.channelId || '', comments: options.comments || 0, - refocusId: options.refocusId || '' + refocusId: options.refocusId || '', + typing: false }); $(ReactDOM.findDOMNode(this.refs.modal)).modal('show'); @@ -118,7 +120,7 @@ class EditPostModal extends React.Component { var self = this; $(ReactDOM.findDOMNode(this.refs.modal)).on('hidden.bs.modal', () => { - self.setState({editText: '', originalText: '', title: '', channel_id: '', post_id: '', comments: 0, refocusId: '', error: ''}); + self.setState({editText: '', originalText: '', title: '', channel_id: '', post_id: '', comments: 0, refocusId: '', error: '', typing: false}); }); $(ReactDOM.findDOMNode(this.refs.modal)).on('show.bs.modal', (e) => { @@ -133,7 +135,8 @@ class EditPostModal extends React.Component { channel_id: $(button).attr('data-channelid'), post_id: $(button).attr('data-postid'), comments: $(button).attr('data-comments'), - refocusId: $(button).attr('data-refocusid') + refocusId: $(button).attr('data-refocusid'), + typing: false }); }); @@ -199,6 +202,7 @@ class EditPostModal extends React.Component { onKeyPress={this.handleEditKeyPress} onKeyDown={this.handleKeyDown} messageText={this.state.editText} + typing={this.state.typing} createMessage={this.props.intl.formatMessage(holders.editPost)} supportsCommands={false} id='edit_textbox' |