diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-06-15 22:39:05 +0200 |
---|---|---|
committer | ThibG <thib@sitedethib.com> | 2018-06-21 22:28:50 +0200 |
commit | f0161702d857a2f91d2e51469e8480253ffcd86e (patch) | |
tree | f74a181ee78099de2385dbe0d4432aaaee9b2885 /app/javascript/flavours/glitch/features/ui/components | |
parent | d0faac90274774625627d9e39d4cea7dba0d7f42 (diff) |
[Glitch] Submit report using meta key
Port 64d7a63f1830e970a6196448cae443ca5d55d1f9 to glitch-soc
Diffstat (limited to 'app/javascript/flavours/glitch/features/ui/components')
-rw-r--r-- | app/javascript/flavours/glitch/features/ui/components/report_modal.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/features/ui/components/report_modal.js b/app/javascript/flavours/glitch/features/ui/components/report_modal.js index ff81522a8..81643b6c2 100644 --- a/app/javascript/flavours/glitch/features/ui/components/report_modal.js +++ b/app/javascript/flavours/glitch/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} /> |