From bc98865c1a97a350d98c1c295f6d67ef69ba5eb5 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 22 Sep 2016 00:09:21 +0200 Subject: [PATCH] API returns mentions for statuses, compose form pre-fills all relevant usernames into the form when replying --- .../features/ui/components/compose_form.jsx | 8 +++++++- .../ui/containers/compose_form_container.jsx | 16 ++-------------- .../javascripts/components/reducers/compose.jsx | 6 +++++- app/views/api/statuses/show.rabl | 8 +++++++- 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/app/assets/javascripts/components/features/ui/components/compose_form.jsx b/app/assets/javascripts/components/features/ui/components/compose_form.jsx index 1aa0b447f6..9453f22ff0 100644 --- a/app/assets/javascripts/components/features/ui/components/compose_form.jsx +++ b/app/assets/javascripts/components/features/ui/components/compose_form.jsx @@ -32,6 +32,12 @@ const ComposeForm = React.createClass({ this.props.onSubmit(); }, + componentDidUpdate (prevProps) { + if (prevProps.text !== this.props.text || prevProps.in_reply_to !== this.props.in_reply_to) { + this.refs.textarea.focus(); + } + }, + render () { let replyArea = ''; @@ -43,7 +49,7 @@ const ComposeForm = React.createClass({
{replyArea} -