From 52b606e78e6f8c59148fb1a3769a74cb0f6f35a0 Mon Sep 17 00:00:00 2001 From: Michiel van der Geest Date: Mon, 26 Feb 2024 22:35:35 +0100 Subject: [PATCH] Fixed errors in key input example. --- src/pages/KeyInput.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/pages/KeyInput.js b/src/pages/KeyInput.js index 7349365..819c0c9 100644 --- a/src/pages/KeyInput.js +++ b/src/pages/KeyInput.js @@ -60,21 +60,13 @@ export default Blits.Component('KeyInput', { }, }, input: { - left(e) { + left() { const focusedX = this.focusedX - 1 - if (focusedX === -1) { - this.parent.focus(e) - } else { - this.focusedX = Math.max(focusedX, 0) - } + this.focusedX = Math.max(focusedX, 0) }, - right(e) { + right() { const focusedX = this.focusedX + 1 - if (focusedX === 4) { - this.parent.focus(e) - } else { - this.focusedX = Math.min(focusedX, 3) - } + this.focusedX = Math.min(focusedX, 3) }, up() { this.focusedY = Math.max(this.focusedY - 1, 0)