Trim answers to avoid false negatives
This commit is contained in:
parent
7214994e33
commit
3913dfa1fa
@ -294,7 +294,7 @@ class ListeningGame {
|
||||
} else {
|
||||
const enteredWord = this.wordInput.value;
|
||||
// console.log('enteredWord: ', enteredWord, 'target: ', this.target);
|
||||
if (enteredWord.toUpperCase() == this.target.toUpperCase()) {
|
||||
if (enteredWord.trim().toUpperCase() == this.target.trim().toUpperCase()) {
|
||||
// If they got the word, show message and switch event listener.
|
||||
this.statusElement.textContent = 'Correct! Press enter to play a new round.';
|
||||
this.messageFound = true;
|
||||
|
Loading…
Reference in New Issue
Block a user