Focus the submit button when boost modal is opened.
intl: PropTypes.object.isRequired,
};
+ componentDidMount() {
+ this.button.focus();
+ }
+
handleReblog = () => {
this.props.onReblog(this.props.status);
this.props.onClose();
}
}
+ setRef = (c) => {
+ this.button = c;
+ }
+
render () {
const { status, intl, onClose } = this.props;
<div className='boost-modal__action-bar'>
<div><FormattedMessage id='boost_modal.combo' defaultMessage='You can press {combo} to skip this next time' values={{ combo: <span>Shift + <i className='fa fa-retweet' /></span> }} /></div>
- <Button text={intl.formatMessage(messages.reblog)} onClick={this.handleReblog} />
+ <Button text={intl.formatMessage(messages.reblog)} onClick={this.handleReblog} ref={this.setRef} />
</div>
</div>
);