From 66414bac8b032f34b5c4d1690b50d6f270a4c5b0 Mon Sep 17 00:00:00 2001 From: "Felix W. Dekker" Date: Fri, 23 Apr 2021 00:34:11 +0200 Subject: [PATCH] Prevent scrolling with arrow keys --- package.json | 2 +- src/main/js/Terminal.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 30e05a5..801fa29 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fwdekker.com", - "version": "0.40.2", + "version": "0.40.3", "description": "The source code of [my personal website](https://fwdekker.com/).", "author": "Felix W. Dekker", "browser": "dist/bundle.js", diff --git a/src/main/js/Terminal.ts b/src/main/js/Terminal.ts index 963f462..649f5cb 100644 --- a/src/main/js/Terminal.ts +++ b/src/main/js/Terminal.ts @@ -310,6 +310,8 @@ export class Terminal { const inputChild = this.input.firstChild; if (inputChild !== null) setTimeout(() => moveCaretToEndOf(inputChild), 0); + + event.preventDefault(); break; } case "arrowdown": { @@ -319,6 +321,8 @@ export class Terminal { const inputChild = this.input.firstChild; if (inputChild !== null) setTimeout(() => moveCaretToEndOf(inputChild), 0); + + event.preventDefault(); break; } case "tab": {