diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2016-02-04 15:07:06 -0500 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2016-02-04 15:17:42 -0500 |
commit | c4344f8c02227f77165f4592e0c87c323b7e00f5 (patch) | |
tree | 3470e795ab81d6ecfa5b9809c37ad2a8efd375cd /web/react/components | |
parent | c11446657f96a155a5dd0790357c992ed719973e (diff) | |
download | chat-c4344f8c02227f77165f4592e0c87c323b7e00f5.tar.gz chat-c4344f8c02227f77165f4592e0c87c323b7e00f5.tar.bz2 chat-c4344f8c02227f77165f4592e0c87c323b7e00f5.zip |
Added focus to the sidebar textbox when it is opened
Diffstat (limited to 'web/react/components')
-rw-r--r-- | web/react/components/create_comment.jsx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/web/react/components/create_comment.jsx b/web/react/components/create_comment.jsx index 797b98ce2..9e7c67515 100644 --- a/web/react/components/create_comment.jsx +++ b/web/react/components/create_comment.jsx @@ -75,6 +75,8 @@ class CreateComment extends React.Component { componentDidMount() { PreferenceStore.addChangeListener(this.onPreferenceChange); window.addEventListener('resize', this.handleResize); + + this.refs.textbox.focus(); } componentWillUnmount() { PreferenceStore.removeChangeListener(this.onPreferenceChange); @@ -95,6 +97,10 @@ class CreateComment extends React.Component { $('.post-right__scroll').perfectScrollbar('update'); } } + + if (prevProps.rootId !== this.props.rootId) { + this.refs.textbox.focus(); + } } handleSubmit(e) { e.preventDefault(); |