Match-id-38d97bf1397ad5c12517c651a4455561a7112616

This commit is contained in:
* 2022-02-17 14:27:09 +08:00 committed by *
parent b84d998fcb
commit b8092c95cc
3 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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)) {

View File

@ -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);
}
}