From 65f51c7bc4bb0b85532a23171306ba7d331c2fd9 Mon Sep 17 00:00:00 2001 From: enahum Date: Mon, 6 Jun 2016 15:54:02 -0300 Subject: PLT-3056 Fix Unable to type quickly in post textbox in IE11 (#3249) --- webapp/components/create_comment.jsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'webapp/components/create_comment.jsx') diff --git a/webapp/components/create_comment.jsx b/webapp/components/create_comment.jsx index 8c80ad993..a9cf68833 100644 --- a/webapp/components/create_comment.jsx +++ b/webapp/components/create_comment.jsx @@ -78,7 +78,8 @@ class CreateComment extends React.Component { previews: draft.previews, submitting: false, ctrlSend: PreferenceStore.getBool(Constants.Preferences.CATEGORY_ADVANCED_SETTINGS, 'send_on_ctrl_enter'), - showPostDeletedModal: false + showPostDeletedModal: false, + typing: false }; } @@ -184,7 +185,8 @@ class CreateComment extends React.Component { submitting: false, postError: null, previews: [], - serverError: null + serverError: null, + typing: false }); } @@ -206,7 +208,9 @@ class CreateComment extends React.Component { PostStore.storeCommentDraft(this.props.rootId, draft); $('.post-right__scroll').parent().scrollTop($('.post-right__scroll')[0].scrollHeight); - this.setState({messageText: messageText}); + + const typing = messageText !== ''; + this.setState({messageText, typing}); } handleKeyDown(e) { @@ -325,7 +329,7 @@ class CreateComment extends React.Component { componentWillReceiveProps(newProps) { if (newProps.rootId !== this.props.rootId) { const draft = PostStore.getCommentDraft(newProps.rootId); - this.setState({messageText: draft.message, uploadsInProgress: draft.uploadsInProgress, previews: draft.previews}); + this.setState({messageText: draft.message, uploadsInProgress: draft.uploadsInProgress, previews: draft.previews, typing: false}); } } @@ -415,6 +419,7 @@ class CreateComment extends React.Component { onKeyPress={this.commentMsgKeyPress} onKeyDown={this.handleKeyDown} messageText={this.state.messageText} + typing={this.state.typing} createMessage={formatMessage(holders.addComment)} initialText='' supportsCommands={false} -- cgit v1.2.3-1-g7c22