1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 02:19:55 +00:00

KeyboardWidget: don't trap keyboard shortcut if actions and message are empty and invokeActions isn't handled (#4971)

* KeyboardWidget: don't trap keyboard shortcut if actions are empty

* Update keyboard.js

* Update keyboard.js
This commit is contained in:
Simon Huber 2020-11-06 18:32:26 +01:00 committed by GitHub
parent 15e8772170
commit d51975b183
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,13 +46,15 @@ KeyboardWidget.prototype.render = function(parent,nextSibling) {
// Add a keyboard event handler
domNode.addEventListener("keydown",function (event) {
if($tw.keyboardManager.checkKeyDescriptors(event,self.keyInfoArray)) {
self.invokeActions(self,event);
var handled = self.invokeActions(self,event);
if(self.actions) {
self.invokeActionString(self.actions,self,event);
}
self.dispatchMessage(event);
event.preventDefault();
event.stopPropagation();
if(handled || self.actions || self.message) {
event.preventDefault();
event.stopPropagation();
}
return true;
}
return false;