mirror of
https://github.com/wekan/wekan.git
synced 2025-04-23 13:37:09 -04:00
Merge pull request #5648 from NadavTasher/bugfix/keyboard-shortcuts-behaving-differently-with-caps
Fix upper-case keyboard shortcuts & different language shortcuts getting triggered when shortcuts are disabled
This commit is contained in:
commit
43e15a1ef4
1 changed files with 2 additions and 2 deletions
|
@ -11,13 +11,13 @@ window.addEventListener('keydown', (e) => {
|
|||
if (String.fromCharCode(e.which).toLowerCase() === e.key) return;
|
||||
|
||||
// Trigger the corresponding action
|
||||
Mousetrap.trigger(String.fromCharCode(e.which).toLowerCase());
|
||||
Mousetrap.handleKey(String.fromCharCode(e.which).toLowerCase(), [], {type: "keypress"});
|
||||
});
|
||||
|
||||
// Overwrite the stopCallback to allow for more keyboard shortcut customizations
|
||||
Mousetrap.stopCallback = (event, element) => {
|
||||
// Are shortcuts enabled for the user?
|
||||
if (!ReactiveCache.getCurrentUser().isKeyboardShortcuts())
|
||||
if (ReactiveCache.getCurrentUser() && !ReactiveCache.getCurrentUser().isKeyboardShortcuts())
|
||||
return true;
|
||||
|
||||
// Always handle escape
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue