Match-id-38d97bf1397ad5c12517c651a4455561a7112616
This commit is contained in:
parent
b84d998fcb
commit
b8092c95cc
|
@ -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);
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue