From ef8705ab6b9f11da77d8056e68b9fc2adb2ef496 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Wed, 23 Sep 2015 15:12:23 -0700 Subject: Text cursor now focuses on the textbox after performing a drag and drop of some text --- web/react/components/create_comment.jsx | 6 +++--- web/react/components/create_post.jsx | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'web/react') diff --git a/web/react/components/create_comment.jsx b/web/react/components/create_comment.jsx index 7cbf6408d..99f553c0c 100644 --- a/web/react/components/create_comment.jsx +++ b/web/react/components/create_comment.jsx @@ -180,9 +180,9 @@ export default class CreateComment extends React.Component { } } handleTextDrop(text) { - const originalText = this.state.messageText; - this.setState({messageText: originalText + text}); - React.findDOMNode(this.refs.textbox).focus(); + const newText = this.state.messageText + text; + this.handleUserInput(newText); + Utils.setCaretPosition(React.findDOMNode(this.refs.textbox.refs.message), newText.length); } removePreview(id) { let previews = this.state.previews; diff --git a/web/react/components/create_post.jsx b/web/react/components/create_post.jsx index 554e1ba35..595643027 100644 --- a/web/react/components/create_post.jsx +++ b/web/react/components/create_post.jsx @@ -232,9 +232,9 @@ export default class CreatePost extends React.Component { } } handleTextDrop(text) { - const originalText = this.state.messageText; - this.setState({messageText: originalText + text}); - React.findDOMNode(this.refs.textbox).focus(); + const newText = this.state.messageText + text; + this.handleUserInput(newText); + Utils.setCaretPosition(React.findDOMNode(this.refs.textbox.refs.message), newText.length); } removePreview(id) { let previews = this.state.previews; -- cgit v1.2.3-1-g7c22