Add (Cmd|Ctrl)+Enter shortcut for submitting from text areas.

RESOLVED FIXED

Status

()

--
enhancement
RESOLVED FIXED
5 years ago
13 days ago

People

(Reporter: pmac, Assigned: kohei)

Tracking

({bmo-ux, ux-efficiency})

Production
bmo-ux, ux-efficiency

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

I tried to get this enhancement into BugzillaJS[0], but it would be even better if it were in BMO proper. It's become fairly standard around the web to use Cmd+Enter (or Ctrl+Enter) to submit a form when focused in a text area, especially in the context of commenting or creating a post. If this worked from the comment and new bug textareas it would be wonderful, with possibly a user pref for (en|dis)abling. The JS for doing this is pretty straight forward as you can see from my code in the PR [0].

[0] https://github.com/gkoberger/BugzillaJS/pull/90

I'm happy to contribute the code for this if one of you kind BMO devs could point me in the direction of the code I should edit.
this probably belongs upstream, but i'm happy to iterate on it on bmo to get the design right.
ideally this should apply to all textarea fields, so that's:

http://git.mozilla.org/?p=webtools/bmo/bugzilla.git;a=blob;f=template/en/default/global/textarea.html.tmpl [github]
http://git.mozilla.org/?p=webtools/bmo/bugzilla.git;a=blob;f=js/field.js [github]
Component: User Interface → User Interface: Modal
https://github.com/mozilla-bteam/bmo/blob/master/extensions/BugModal/web/bug_modal.js#L1021

Sketch of the logic, I think:

When the user types cmd-enter or ctrl-enter:

If comment area is focused OR the preview area of the comment is visible, save changes.
Otherwise, ignore.
Sounds right to me. Thanks Dylan!
:nchevobbe wants this. https://twitter.com/nicolaschevobbe/status/1050673582274109442

The comment editor I’m working on and currently under review (Bug 1484892) comes with a Ctrl/Cmd+Enter shortcut, so it’s would be nice to have the same for the Add Comment field. Will work on this soon.
Assignee: nobody → kohei.yoshino
Severity: normal → enhancement
Status: NEW → ASSIGNED
Component: User Interface: Modal → General
Keywords: bmo-ux, ux-efficiency
Merged to master.
Status: ASSIGNED → RESOLVED
Last Resolved: 5 months ago
Resolution: --- → FIXED
Duplicate of this bug: 895232
You need to log in before you can comment on or make changes to this bug.