diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2016-02-04 11:32:39 -0500 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2016-02-04 14:49:10 -0500 |
commit | c11446657f96a155a5dd0790357c992ed719973e (patch) | |
tree | ad5521cdf7178e5fb5720555fc4783d7aec5b3fa /web | |
parent | eec9f88110a83083ecd68a1d33e36a65b373bdc5 (diff) | |
download | chat-c11446657f96a155a5dd0790357c992ed719973e.tar.gz chat-c11446657f96a155a5dd0790357c992ed719973e.tar.bz2 chat-c11446657f96a155a5dd0790357c992ed719973e.zip |
Added code to refocus on the post/comment textbox after a file is drag and dropped
Diffstat (limited to 'web')
-rw-r--r-- | web/react/components/create_comment.jsx | 4 | ||||
-rw-r--r-- | web/react/components/create_post.jsx | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/web/react/components/create_comment.jsx b/web/react/components/create_comment.jsx index 387d5bd8b..797b98ce2 100644 --- a/web/react/components/create_comment.jsx +++ b/web/react/components/create_comment.jsx @@ -229,6 +229,10 @@ class CreateComment extends React.Component { PostStore.storeCommentDraft(this.props.rootId, draft); this.setState({uploadsInProgress: draft.uploadsInProgress}); + + // this is a bit redundant with the code that sets focus when the file input is clicked, + // but this also resets the focus after a drag and drop + this.refs.textbox.focus(); } handleFileUploadComplete(filenames, clientIds) { let draft = PostStore.getCommentDraft(this.props.rootId); diff --git a/web/react/components/create_post.jsx b/web/react/components/create_post.jsx index e102d1d29..38011e38f 100644 --- a/web/react/components/create_post.jsx +++ b/web/react/components/create_post.jsx @@ -230,6 +230,10 @@ class CreatePost extends React.Component { PostStore.storeDraft(channelId, draft); this.setState({uploadsInProgress: draft.uploadsInProgress}); + + // this is a bit redundant with the code that sets focus when the file input is clicked, + // but this also resets the focus after a drag and drop + this.refs.textbox.focus(); } handleFileUploadComplete(filenames, clientIds, channelId) { const draft = PostStore.getDraft(channelId); |