Resolve #265 regarding shortcuts in certain input fields.

As we want other shortcuts do work in input fields (which couldn't in previous releases).
This commit is contained in:
the-djmaze 2022-03-04 14:43:58 +01:00
parent 54f48fbe4d
commit a503329b77
5 changed files with 35 additions and 28 deletions

View file

@ -2,7 +2,7 @@ import { koArrayWithDestroy } from 'External/ko';
import { SaveSettingsStep } from 'Common/Enums';
import { ComposeType } from 'Common/EnumsUser';
import { doc } from 'Common/Globals';
import { registerShortcut } from 'Common/Globals';
import { arrayLength, pInt } from 'Common/Utils';
import { download, computedPaginatorHelper, showMessageComposer } from 'Common/UtilsUser';
@ -449,15 +449,12 @@ export class ContactsPopupView extends AbstractViewPopup {
onBuild(dom) {
this.selector.init(dom.querySelector('.b-list-content'), ScopeContacts);
shortcuts.add('delete', '', ScopeContacts, () => {
if (doc.activeElement && doc.activeElement.matches('input,textarea')) {
return true;
}
registerShortcut('delete', '', ScopeContacts, () => {
this.deleteCommand();
return false;
});
shortcuts.add('c,w', '', ScopeContacts, () => {
registerShortcut('c,w', '', ScopeContacts, () => {
this.newMessageCommand();
return false;
});