fix(练习): 修复Windows平台中文输入法问题
- 输入法组合期间阻止自动跳转和字符分散 - 输入法确认后将组合字符正确分散到多个输入框 - 确保中文输入正常工作 via [HAPI](https://hapi.run) Co-Authored-By: HAPI <noreply@hapi.run>
This commit is contained in:
@@ -42,6 +42,13 @@ export function InputArea({
|
||||
|
||||
const newInput = [...userInput]
|
||||
|
||||
// 输入法组合期间,只更新当前输入框的值,不做任何跳转
|
||||
if (isComposing) {
|
||||
newInput[index] = value
|
||||
onInputChange(newInput)
|
||||
return
|
||||
}
|
||||
|
||||
// 处理多字符输入(连续输入或粘贴)
|
||||
if (value.length > 1) {
|
||||
const chars = value.split('')
|
||||
|
||||
Reference in New Issue
Block a user