Skip to content

Commit

Permalink
Merge pull request #207 from Progress1/key_fix
Browse files Browse the repository at this point in the history
Fix: disable shorcuts on text/textarea fields (prevents typing text)
  • Loading branch information
Progress1 authored Mar 7, 2024
2 parents 71c679c + 4c6f56d commit fa1c820
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 fa1c820

Please sign in to comment.