Fixes issue with preventDefault being called in timeout

This commit is contained in:
Mo Bitar
2019-05-12 11:55:17 -05:00
parent 6c5d01a99d
commit f5e877e055
3 changed files with 18 additions and 12 deletions

View File

@@ -803,10 +803,14 @@ angular.module('app')
this.altKeyObserver = keyboardManager.addKeyObserver({
modifiers: [KeyboardManager.KeyModifierAlt],
onKeyDown: () => {
this.altKeyDown = true;
$timeout(() => {
this.altKeyDown = true;
})
},
onKeyUp: () => {
this.altKeyDown = false;
$timeout(() => {
this.altKeyDown = false;
});
}
})
@@ -815,7 +819,9 @@ angular.module('app')
notElementIds: ["note-text-editor", "note-title-editor"],
modifiers: [KeyboardManager.KeyModifierMeta],
onKeyDown: () => {
this.deleteNote();
$timeout(() => {
this.deleteNote();
});
},
})
@@ -868,8 +874,10 @@ angular.module('app')
editor.selectionStart = editor.selectionEnd = start + 4;
}
this.note.text = editor.value;
this.changesMade({bypassDebouncer: true});
$timeout(() => {
this.note.text = editor.value;
this.changesMade({bypassDebouncer: true});
})
},
})