Still issue with shortcuts

https://github.com/the-djmaze/snappymail/issues/277#issuecomment-1064880609
This commit is contained in:
the-djmaze 2022-03-11 10:36:27 +01:00
parent d6dc4d291c
commit 088d6cab55

View file

@ -1,5 +1,5 @@
import ko from 'ko'; import ko from 'ko';
import { addEventsListeners, addShortcut } from 'Common/Globals'; import { addEventsListeners, addShortcut, registerShortcut } from 'Common/Globals';
import { isArray } from 'Common/Utils'; import { isArray } from 'Common/Utils';
import { koComputable } from 'External/ko'; import { koComputable } from 'External/ko';
@ -266,7 +266,7 @@ export class Selector {
} }
}); });
addShortcut('enter,open', '', keyScope, () => { registerShortcut('enter,open', '', keyScope, () => {
const focused = this.focusedItem(); const focused = this.focusedItem();
if (focused && !focused.selected()) { if (focused && !focused.selected()) {
this.actionClick(focused); this.actionClick(focused);
@ -280,7 +280,7 @@ export class Selector {
this.newSelectPosition(event.key, true); this.newSelectPosition(event.key, true);
return false; return false;
}); });
addShortcut('arrowup,arrowdown,home,end,pageup,pagedown,space', '', keyScope, event => { registerShortcut('arrowup,arrowdown,home,end,pageup,pagedown,space', '', keyScope, event => {
this.newSelectPosition(event.key, false); this.newSelectPosition(event.key, false);
return false; return false;
}); });