diff options
author | Nick Van Doorn <vandoorn.nick@gmail.com> | 2020-03-27 15:24:37 -0700 |
---|---|---|
committer | Nick Van Doorn <vandoorn.nick@gmail.com> | 2020-03-27 15:24:37 -0700 |
commit | 587783bdbf7228c7c1c825ccce5df6403db7ab20 (patch) | |
tree | 5b2052ab4229c6c40ab1bc13f23e65abb83e2bed | |
parent | 3581940fb0cade9ef2782093998e4f0196336396 (diff) |
-rw-r--r-- | main.js | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 } } |