From dbccdcc1b1e295b7f05a7867936e858ea26f0d6b Mon Sep 17 00:00:00 2001 From: unarist Date: Thu, 1 Jun 2017 11:20:10 +0900 Subject: [PATCH] Focus the submit button on the boost modal (#3494) Focus the submit button when boost modal is opened. --- .../mastodon/features/ui/components/boost_modal.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/javascript/mastodon/features/ui/components/boost_modal.js b/app/javascript/mastodon/features/ui/components/boost_modal.js index 183f05fab1..9d99b53361 100644 --- a/app/javascript/mastodon/features/ui/components/boost_modal.js +++ b/app/javascript/mastodon/features/ui/components/boost_modal.js @@ -27,6 +27,10 @@ class BoostModal extends ImmutablePureComponent { intl: PropTypes.object.isRequired, }; + componentDidMount() { + this.button.focus(); + } + handleReblog = () => { this.props.onReblog(this.props.status); this.props.onClose(); @@ -40,6 +44,10 @@ class BoostModal extends ImmutablePureComponent { } } + setRef = (c) => { + this.button = c; + } + render () { const { status, intl, onClose } = this.props; @@ -67,7 +75,7 @@ class BoostModal extends ImmutablePureComponent {
Shift + }} />
-
);