fix(练习): 修复中文输入法和字符验证问题

- 移除 input maxLength 限制,支持输入法多字符输入
- 使用 ref 保存最新输入状态,避免闭包导致的状态滞后
- 重构验证逻辑,修复字符对比错误(对比原始答案而非标准化答案)
- 修复输入法确认后验证使用旧数据的问题

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <noreply@hapi.run>
This commit is contained in:
ittoview
2026-03-01 15:15:37 +00:00
parent 977187b2d5
commit a38e275642
2 changed files with 34 additions and 27 deletions

View File

@@ -134,7 +134,6 @@ export function InputArea({
!isComposing && isError && 'border-red-500',
inputLocked && 'cursor-not-allowed opacity-50'
)}
maxLength={1}
autoComplete="off"
autoCorrect="off"
autoCapitalize="off"