Skip to content

Commit

Permalink
fix(shortcuts): disable shortcuts on any input element
Browse files Browse the repository at this point in the history
  • Loading branch information
mbaraa committed May 28, 2024
1 parent 1be5c11 commit 59e1149
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions static/js/player_shortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ const shortcuts = {
* @param {KeyboardEvent} e
*/
document.addEventListener("keyup", (e) => {
if (
[searchFormEl, searchInputEl, searchSugEl].includes(document.activeElement)
) {
if (document.activeElement.tagName === "INPUT") {
return;
}
const action = shortcuts[e.key];
Expand All @@ -54,9 +52,7 @@ document.addEventListener("keyup", (e) => {
* @param {KeyboardEvent} e
*/
document.addEventListener("keydown", (e) => {
if (
[searchFormEl, searchInputEl, searchSugEl].includes(document.activeElement)
) {
if (document.activeElement.tagName === "INPUT") {
return;
}
const action = shortcuts[e.key];
Expand Down

0 comments on commit 59e1149

Please sign in to comment.