fix(mini): preserve child name input during pinyin composition

This commit is contained in:
stu2not
2026-10-14 10:52:39 +08:00
parent 7d05e78a64
commit a02e0d5f13
3 changed files with 5 additions and 10 deletions
+3 -3
View File
@@ -20,7 +20,6 @@ import {
CHILD_NAME_RULE_MESSAGE,
createChild,
getChildren,
sanitizeChildNameInput,
resolveChildSelection,
setSelectedChildId as setStoredSelectedChildId,
validateChildNameInput,
@@ -804,9 +803,10 @@ export default function Bind() {
? children.length > 0 ? '不选已有宝贝时,可填写2-5位简体中文姓名(暂不支持数字和英文)' : CHILD_NAME_RULE_MESSAGE
: children.length > 0 ? '不选已有宝贝时,可填写2-5位简体中文姓名(暂不支持数字和英文)' : '可不填,稍后再关联宝贝'
}
maxlength={5}
maxlength={-1}
onInput={(event) => {
const nextChildName = sanitizeChildNameInput(event.detail.value)
// Preserve pinyin composition; validate the final name on submit.
const nextChildName = event.detail.value
setNewChildName(nextChildName)
if (nextChildName) {
setSelectedChildId(null)