mirror of https://github.com/zulip/zulip.git
hotkeys: Deactivate `cmd-or-ctrl + shift` hotkeys.
This disables `cmd-or-ctrl + shift + k` and `cmd-or-ctrl + shift + s`, while `cmd-or-ctrl + k` and `cmd-or-ctrl + s` will still trigger actions. Also, add tests for ensuring that the `cmd-or-ctrl + shift` combinations fall through. Fix #9779.
This commit is contained in:
parent
af5de189d8
commit
56f711d5ff
|
@ -121,6 +121,8 @@ run_test('mappings', () => {
|
|||
assert.equal(map_down(77, false, true), undefined); // ctrl + m
|
||||
assert.equal(map_down(75, false, false, true), undefined); // cmd + k
|
||||
assert.equal(map_down(83, false, false, true), undefined); // cmd + s
|
||||
assert.equal(map_down(75, true, true), undefined); // shift + ctrl + k
|
||||
assert.equal(map_down(83, true, true), undefined); // shift + ctrl + s
|
||||
|
||||
// CMD tests for MacOS
|
||||
global.navigator.userAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36";
|
||||
|
|
|
@ -126,7 +126,7 @@ exports.get_keydown_hotkey = function (e) {
|
|||
}
|
||||
|
||||
var isCmdOrCtrl = /Mac/i.test(navigator.userAgent) ? e.metaKey : e.ctrlKey;
|
||||
if (isCmdOrCtrl) {
|
||||
if (isCmdOrCtrl && !e.shiftKey) {
|
||||
hotkey = keydown_cmd_or_ctrl_mappings[e.which];
|
||||
if (hotkey) {
|
||||
return hotkey;
|
||||
|
|
Loading…
Reference in New Issue