Make sure there's no accidental space before or after the word

This commit is contained in:
2024-11-09 18:46:13 +01:00
parent 4afa475d63
commit c0c0ecb28b

View File

@@ -36,7 +36,8 @@ document.addEventListener('alpine:init', () => {
async doGuess() { async doGuess() {
this.guessError = null; 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 === '') { if (this.guessValue === '') {
console.log('Nothing filled in'); console.log('Nothing filled in');