summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2025-03-05 12:00:52 +0100
committerYuval Adam <_@yuv.al>2025-03-05 12:00:52 +0100
commitc6612a8b6dde5a5a9776d424ed33f5ca685699c6 (patch)
treefb8f55375cde64fa492fc03f5d8aaaf32d437d65
parentd9abe6078499206ac65a2721433f502a7b2432f1 (diff)
fix states
-rw-r--r--morsehero/src/pages/HomePage.tsx8
1 files changed, 8 insertions, 0 deletions
diff --git a/morsehero/src/pages/HomePage.tsx b/morsehero/src/pages/HomePage.tsx
index 7ec4e90..bf07bd5 100644
--- a/morsehero/src/pages/HomePage.tsx
+++ b/morsehero/src/pages/HomePage.tsx
@@ -48,6 +48,14 @@ const HomePage = () => {
// Clear feedback
setFeedback('');
+ // Reset button states
+ optionButtonsRef.current.forEach(button => {
+ if (button) {
+ button.disabled = false;
+ button.classList.remove('correct', 'incorrect', 'key-pressed');
+ }
+ });
+
// Generate a random character
const randomIndex = Math.floor(Math.random() * allChars.length);
const newChar = allChars[randomIndex];