mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-19 05:12:41 +01:00
Make Cmd+Enter work to submit a form
Summary: Fixes T3010. `keydown` is what you're supposed to use for special keys like `Enter`; `keypress` didn't work for me for Cmd+Enter on Chrome. Test Plan: Submitted a Differential field with Cmd+Enter on Chrome Mac. Also made sure Ctrl+Enter still works and Opt+Enter does not. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Maniphest Tasks: T3010 Differential Revision: https://secure.phabricator.com/D8699
This commit is contained in:
parent
e3b5737d02
commit
077f57f06d
1 changed files with 2 additions and 2 deletions
|
@ -15,9 +15,9 @@ JX.behavior('aphront-form-disable-on-submit', function(config) {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
JX.Stratcom.listen('keypress', ['tag:form', 'tag:textarea'], function(e) {
|
JX.Stratcom.listen('keydown', ['tag:form', 'tag:textarea'], function(e) {
|
||||||
var raw = e.getRawEvent();
|
var raw = e.getRawEvent();
|
||||||
if (e.getSpecialKey() != 'return' || !raw.ctrlKey) {
|
if (!(e.getSpecialKey() === 'return' && (raw.ctrlKey || raw.metaKey))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue