Skip to content

Commit

Permalink
Don't allow keyboard control binding toggle when an input is focused
Browse files Browse the repository at this point in the history
  • Loading branch information
zachallaun committed Aug 7, 2023
1 parent efae672 commit 7573b91
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion assets/js/hooks/keyboard_control.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ const KeyboardControl = {
},

handleDocumentKeyDown(event) {
if (this.isKeyboardToggle(event)) {
if (
this.isKeyboardToggle(event) &&
!isEditableElement(document.activeElement)
) {
cancelEvent(event);
this.keyboardEnabled() ? this.disableKeyboard() : this.enableKeyboard();
return;
Expand Down

0 comments on commit 7573b91

Please sign in to comment.