From c0c0ecb28bf032c17f2d06fb3ae5f49cde1bf0a5 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Sat, 9 Nov 2024 18:46:13 +0100 Subject: [PATCH] Make sure there's no accidental space before or after the word --- src/alfagok/static/game.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/alfagok/static/game.js b/src/alfagok/static/game.js index 05af3b2..0ea9245 100644 --- a/src/alfagok/static/game.js +++ b/src/alfagok/static/game.js @@ -36,7 +36,8 @@ document.addEventListener('alpine:init', () => { async doGuess() { this.guessError = null; - this.guessValue = this.guessValue.toLowerCase(); + /* Normalise on lowercase, and strip whitespace from begin and end, just in case */ + this.guessValue = this.guessValue.toLowerCase().trim(); if (this.guessValue === '') { console.log('Nothing filled in');