diff --git a/libs/horizon/src/dom/DOMOperator.ts b/libs/horizon/src/dom/DOMOperator.ts index 9e61d65a..169e85b2 100644 --- a/libs/horizon/src/dom/DOMOperator.ts +++ b/libs/horizon/src/dom/DOMOperator.ts @@ -165,7 +165,7 @@ export function submitDomUpdate(tag: string, vNode: VNode) { // 应用diff更新Properties. // 当一个选中的radio改变名称,浏览器使另一个radio的复选框为false. if (type === 'input' && newProps.type === 'radio' && newProps.name != null && newProps.checked != null) { - updateCommonProp(element, 'checked', newProps.checked); + updateCommonProp(element, 'checked', newProps.checked, true); } const isNativeTag = isNativeElement(type, newProps); updateDomProps(element, changeList, isNativeTag); diff --git a/libs/horizon/src/dom/DOMPropertiesHandler/UpdateCommonProp.ts b/libs/horizon/src/dom/DOMPropertiesHandler/UpdateCommonProp.ts index 5af59913..468408ac 100644 --- a/libs/horizon/src/dom/DOMPropertiesHandler/UpdateCommonProp.ts +++ b/libs/horizon/src/dom/DOMPropertiesHandler/UpdateCommonProp.ts @@ -29,7 +29,7 @@ function convertToLowerCase(str) { * attrName 指代码中属性设置的属性名称(如 class) * 多数情况 attrName 仅用作初始 DOM 节点对象使用,而 property 更多用于页面交互 */ -export function updateCommonProp(dom: Element, attrName: string, value: any, isNativeTag: boolean = true) { +export function updateCommonProp(dom: Element, attrName: string, value: any, isNativeTag: boolean) { const propDetails = getPropDetails(attrName); if (isInvalidValue(attrName, value, propDetails, isNativeTag)) { diff --git a/libs/horizon/src/dom/valueHandler/InputValueHandler.ts b/libs/horizon/src/dom/valueHandler/InputValueHandler.ts index e081a5ea..368bf288 100644 --- a/libs/horizon/src/dom/valueHandler/InputValueHandler.ts +++ b/libs/horizon/src/dom/valueHandler/InputValueHandler.ts @@ -37,7 +37,7 @@ export function updateInputValue(dom: HTMLInputElement, properties: IProperty) { dom.value = String(value); } } else if (checked != null) { - updateCommonProp(dom, 'checked', checked); + updateCommonProp(dom, 'checked', checked, true); } }