prevent default on any keystroke

This commit is contained in:
marlon-erler
2026-04-14 09:41:02 +00:00
parent ce77af0094
commit 311e6770c3
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -2271,6 +2271,7 @@
}; };
this.handleKeyDown = (e) => { this.handleKeyDown = (e) => {
if (_CoreViewModel.checkIsKeystroke(e) == false) return; if (_CoreViewModel.checkIsKeystroke(e) == false) return;
e.preventDefault();
const contexts = this.contexts; const contexts = this.contexts;
while (contexts.length > 0) { while (contexts.length > 0) {
const currentContext = contexts.pop(); const currentContext = contexts.pop();
@@ -2314,7 +2315,6 @@
e.key.toLowerCase() e.key.toLowerCase()
); );
if (!fn) return false; if (!fn) return false;
e.preventDefault();
fn(); fn();
return true; return true;
}; };
+2 -2
View File
@@ -8,7 +8,7 @@ import FileTransferModel from "../../Model/Global/fileTransferModel";
import { v4 } from "uuid"; import { v4 } from "uuid";
export default class CoreViewModel { export default class CoreViewModel {
readonly BUILD = "Build 26.04.14.B"; readonly BUILD = "Build 26.04.14.C";
translations: Translations; translations: Translations;
@@ -40,6 +40,7 @@ export default class CoreViewModel {
handleKeyDown = (e: KeyboardEvent): void => { handleKeyDown = (e: KeyboardEvent): void => {
if (CoreViewModel.checkIsKeystroke(e) == false) return; if (CoreViewModel.checkIsKeystroke(e) == false) return;
e.preventDefault();
const contexts: Context[] = this.contexts; const contexts: Context[] = this.contexts;
while (contexts.length > 0) { while (contexts.length > 0) {
const currentContext: Context | undefined = contexts.pop(); const currentContext: Context | undefined = contexts.pop();
@@ -89,7 +90,6 @@ export class Context {
e.key.toLowerCase(), e.key.toLowerCase(),
); );
if (!fn) return false; if (!fn) return false;
e.preventDefault();
fn(); fn();
return true; return true;
}; };