commit 32e07d350f0a67f7700d4d117abfd67f4f6b5be1
parent 89ee7d80573f83793b6de27c92d8d06360fb9ddc
Author: ashermorgan <59518073+ashermorgan@users.noreply.github.com>
Date: Mon, 24 May 2021 11:55:21 -0700
Fix bug in keyboard shortcut detection
Keyboard shortcuts no longer fire when extra modifiers are present
Diffstat:
4 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/js/app.js b/js/app.js
@@ -89,7 +89,7 @@ const homePage = Vue.component("homePage", {
* @param {object} e - The event args.
*/
keyup: function(e) {
- if (this._inactive) return;
+ if (this._inactive || e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) return;
if (e.key === "c") this.$router.push("verbs");
if (e.key === "v") this.$router.push("vocab");
if (e.key === ",") this.$router.push("settings");
diff --git a/js/filtersPage.js b/js/filtersPage.js
@@ -370,7 +370,7 @@ const filtersPage = Vue.component("filtersPage", {
* @param {object} e - The event args.
*/
keyup: function(e) {
- if (this._inactive) return;
+ if (this._inactive || e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) return;
if (e.key === ",") this.$router.push({name:"settings", params:{referer:this.$route.name}});
if (e.key === "s") this.StartSession();
}
diff --git a/js/quizzer.js b/js/quizzer.js
@@ -97,6 +97,7 @@ const quizzer = Vue.component("quizzer", {
* Handles keyup events and implements quizzer keyboard shortcuts
*/
keyup: function(e) {
+ if (this._inactive || e.altKey || e.shiftKey || e.metaKey) return;
if (e.keyCode === 13 && e.ctrlKey && document.activeElement.tagName !== "BUTTON") {
this.Reset();
}
diff --git a/js/reference.js b/js/reference.js
@@ -164,7 +164,7 @@ const referenceTables = Vue.component("referenceTables", {
* @param {object} e - The event args.
*/
keyup: function(e) {
- if (this._inactive) return;
+ if (this._inactive || e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) return;
if (e.keyCode === 13 && this.$refs.search === document.activeElement) this.search();
if (this.$refs.search === document.activeElement) return;
if (e.key === "h" || e.key == "/") {