diff --git a/src/components/Exercises/WriteBlanks.tsx b/src/components/Exercises/WriteBlanks.tsx index 66624bb6..e89d57a4 100644 --- a/src/components/Exercises/WriteBlanks.tsx +++ b/src/components/Exercises/WriteBlanks.tsx @@ -27,8 +27,8 @@ function Blank({ const [userInput, setUserInput] = useState(userSolution || ""); useEffect(() => { - const words = userInput.split(" ").filter((x) => x !== ""); - if (words.length >= maxWords) { + const words = userInput.split(" "); + if (words.length > maxWords) { toast.warning(`You have reached your word limit of ${maxWords} words!`, {toastId: "word-limit"}); setUserInput(words.join(" ").trim()); }