Skip to content

Commit

Permalink
Fix #2701: Do not show shortcut box when modifier key is pressed
Browse files Browse the repository at this point in the history
  • Loading branch information
mpsijm committed Sep 25, 2024
1 parent bd5f9e5 commit 56329f0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions webapp/public/js/domjudge.js
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,10 @@ function initializeKeyboardShortcuts() {
if (keysCookie != 1 && keysCookie != "") {
return;
}
// Do not trigger shortcuts if user is pressing Ctrl/Alt/Option/Meta key.
if (e.altKey || e.ctrlKey || e.metaKey) {
return;
}
// Check if the user is not typing in an input field.
if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') {
return;
Expand Down

0 comments on commit 56329f0

Please sign in to comment.