summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Van Doorn <vandoorn.nick@gmail.com>2020-03-27 15:24:37 -0700
committerNick Van Doorn <vandoorn.nick@gmail.com>2020-03-27 15:24:37 -0700
commit587783bdbf7228c7c1c825ccce5df6403db7ab20 (patch)
tree5b2052ab4229c6c40ab1bc13f23e65abb83e2bed
parent3581940fb0cade9ef2782093998e4f0196336396 (diff)
Reset incorrect portion of wordHEADmaster
-rw-r--r--main.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.js b/main.js
index b8ece73..d08f324 100644
--- a/main.js
+++ b/main.js
@@ -52,7 +52,10 @@
state.set({ currentWordIndex: currentWordIndex + 1, currentMatchIndex: 0 })
}
else {
- state.set({ currentMatchIndex: currentMatchPosition(currentWord) })
+ const currentMatchIndex = currentMatchPosition(currentWord)
+ const correctSegment = mainInput.value.slice(0, currentMatchIndex)
+ state.set({ currentMatchIndex })
+ mainInput.value = correctSegment
}
}