diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2017-01-10 09:08:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-10 09:08:37 -0500 |
commit | 7846036c778d13bdc285f82746d3f27611508b5d (patch) | |
tree | a7a55ebdd485b9c2c937975d06326a636c526be5 /webapp/components/create_comment.jsx | |
parent | 78cadf7d6005fe38bf63fa7c145370b1d44eb9ec (diff) | |
download | chat-7846036c778d13bdc285f82746d3f27611508b5d.tar.gz chat-7846036c778d13bdc285f82746d3f27611508b5d.tar.bz2 chat-7846036c778d13bdc285f82746d3f27611508b5d.zip |
Stopped rerendering CreatePost/CreateComment when blurring textbox (#5026)
Diffstat (limited to 'webapp/components/create_comment.jsx')
-rw-r--r-- | webapp/components/create_comment.jsx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/webapp/components/create_comment.jsx b/webapp/components/create_comment.jsx index 09ec32b6b..0e9d2a41a 100644 --- a/webapp/components/create_comment.jsx +++ b/webapp/components/create_comment.jsx @@ -67,9 +67,10 @@ export default class CreateComment extends React.Component { fileInfos: draft.fileInfos, submitting: false, ctrlSend: PreferenceStore.getBool(Constants.Preferences.CATEGORY_ADVANCED_SETTINGS, 'send_on_ctrl_enter'), - showPostDeletedModal: false, - lastBlurAt: 0 + showPostDeletedModal: false }; + + this.lastBlurAt = 0; } componentDidMount() { @@ -145,7 +146,7 @@ export default class CreateComment extends React.Component { }); const fasterThanHumanWillClick = 150; - const forceFocus = (Date.now() - this.state.lastBlurAt < fasterThanHumanWillClick); + const forceFocus = (Date.now() - this.lastBlurAt < fasterThanHumanWillClick); this.focusTextbox(forceFocus); } @@ -405,7 +406,7 @@ export default class CreateComment extends React.Component { } handleBlur() { - this.setState({lastBlurAt: Date.now()}); + this.lastBlurAt = Date.now(); } render() { |