diff options
author | Yamagishi Kazutoshi <ykzts@desire.sh> | 2018-06-04 20:09:52 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2018-06-04 13:09:52 +0200 |
commit | 64d7a63f1830e970a6196448cae443ca5d55d1f9 (patch) | |
tree | 9fe6587369a04ac084065bb985e371ee5560761b | |
parent | c0fc4e99354ae7530c69bbbb81dc08d8c3e403fc (diff) |
Submit report using meta key (#7729)
-rw-r--r-- | app/javascript/mastodon/features/ui/components/report_modal.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/javascript/mastodon/features/ui/components/report_modal.js b/app/javascript/mastodon/features/ui/components/report_modal.js index 8616f0315..90f001319 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} /> |