Skip to content

Commit

Permalink
fix(shortcuts): ignore ctrl and alt presses
Browse files Browse the repository at this point in the history
  • Loading branch information
mbaraa committed Jun 13, 2024
1 parent d4536e3 commit b87419e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/static/js/player_shortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ const shortcuts = {
document.addEventListener("keyup", (e) => {
if (
document.activeElement.tagName === "INPUT" ||
document.activeElement.id.startsWith("search-suggestion")
document.activeElement.id.startsWith("search-suggestion") ||
e.ctrlKey ||
e.altKey
) {
return;
}
Expand All @@ -60,7 +62,12 @@ document.addEventListener("keyup", (e) => {
* @param {KeyboardEvent} e
*/
document.addEventListener("keydown", (e) => {
if (document.activeElement.tagName === "INPUT") {
if (
document.activeElement.tagName === "INPUT" ||
document.activeElement.id.startsWith("search-suggestion") ||
e.ctrlKey ||
e.altKey
) {
return;
}
const action = shortcuts[e.key];
Expand Down

0 comments on commit b87419e

Please sign in to comment.