From 10a8ac8b8014a72002786a2c3353be9d576f25c0 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Mon, 4 Jun 2018 20:09:52 +0900 Subject: [PATCH] Submit report using meta key (#7729) --- .../mastodon/features/ui/components/report_modal.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/javascript/mastodon/features/ui/components/report_modal.js b/app/javascript/mastodon/features/ui/components/report_modal.js index 8616f0315c..90f0013197 100644 --- a/app/javascript/mastodon/features/ui/components/report_modal.js +++ b/app/javascript/mastodon/features/ui/components/report_modal.js @@ -63,6 +63,12 @@ export default class ReportModal extends ImmutablePureComponent { this.props.dispatch(submitReport()); } + handleKeyDown = e => { + if (e.keyCode === 13 && (e.ctrlKey || e.metaKey)) { + this.handleSubmit(); + } + } + componentDidMount () { this.props.dispatch(expandAccountTimeline(this.props.account.get('id'), { withReplies: true })); } @@ -98,6 +104,7 @@ export default class ReportModal extends ImmutablePureComponent { placeholder={intl.formatMessage(messages.placeholder)} value={comment} onChange={this.handleCommentChange} + onKeyDown={this.handleKeyDown} disabled={isSubmitting} />