From 73433fed1354de26d047783d579ade743d285513 Mon Sep 17 00:00:00 2001 From: Jack Date: Sat, 15 Aug 2020 01:20:11 +0100 Subject: [PATCH] fixed a bug where backspacing the first word in the first row after scrolling would break the website --- public/js/script.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/js/script.js b/public/js/script.js index 7cbdfa9f7..c21432769 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -3491,7 +3491,11 @@ $(document).keydown((event) => { if (event["keyCode"] == 8) { event.preventDefault(); if (!testActive) return; - if (currentInput == "" && inputHistory.length > 0) { + if ( + currentInput == "" && + inputHistory.length > 0 && + currentWordElementIndex > 0 + ) { if ( (inputHistory[currentWordIndex - 1] == wordsList[currentWordIndex - 1] &&