Skip to content

Commit

Permalink
Fix: disable shorcuts on text/textarea fields (prevents typing text)
Browse files Browse the repository at this point in the history
Example: Assess, create report from item and you type N in description field -> all is canceled and it creates new report again
  • Loading branch information
Jan Polonsky committed Feb 2, 2024
1 parent 057d509 commit 4c6f56d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/gui/src/assets/keyboard_mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,12 @@ const keyboardMixin = targetId => ({
}
}
// window.console.debug("keyAlias:", keyAlias, "activeElement:", document.activeElement);
if ((document.activeElement == search_field || document.activeElement.className == "ql-editor") && (keyAlias !== 'close_item' || press.keyCode !== 27)) {
// when search field or editor is active, ignore all keypresses except Escape
if ((document.activeElement == search_field ||
document.activeElement.className == "ql-editor" ||
document.activeElement.type == "text" ||
document.activeElement.type == "textarea") && (keyAlias !== 'close_item' || press.keyCode !== 27)) {
// when search field, editor, text or textarea is active, ignore all keypresses except Escape
// example problem: Assess, create report from item and you type N in description field -> all is canceled and it creates new report again
return;
}

Expand Down

0 comments on commit 4c6f56d

Please sign in to comment.