From 81555b938df3f74610ce255485502c0c00259c46 Mon Sep 17 00:00:00 2001 From: Lynn Date: Sun, 16 Jan 2022 23:06:29 +0100 Subject: [PATCH] Prevent backspace navigation --- src/Game.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Game.tsx b/src/Game.tsx index f9bbb10..afd848a 100644 --- a/src/Game.tsx +++ b/src/Game.tsx @@ -96,6 +96,9 @@ function Game(props: GameProps) { if (!e.ctrlKey && !e.metaKey) { onKey(e.key); } + if (e.key === "Backspace") { + e.preventDefault(); + } }; document.addEventListener("keydown", onKeyDown); return () => {