]> cat aescling's git repositories - mastodon.git/commitdiff
Submit report using meta key (#7729)
authorYamagishi Kazutoshi <ykzts@desire.sh>
Mon, 4 Jun 2018 11:09:52 +0000 (20:09 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Mon, 4 Jun 2018 11:09:52 +0000 (13:09 +0200)
app/javascript/mastodon/features/ui/components/report_modal.js

index 8616f0315ceccddb3a74954d6777c89af691b74e..90f0013197060e5af37ccfb0d3d6a745d8144147 100644 (file)
@@ -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}
             />