Skip to content

Commit c0d8db8

Browse files
committed
fix(runtime-core): unset removed props first in full diff mode
fix #6571
1 parent c71a08e commit c0d8db8

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

packages/runtime-core/src/renderer.ts

+17-17
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,23 @@ function baseCreateRenderer(
10051005
isSVG: boolean
10061006
) => {
10071007
if (oldProps !== newProps) {
1008+
if (oldProps !== EMPTY_OBJ) {
1009+
for (const key in oldProps) {
1010+
if (!isReservedProp(key) && !(key in newProps)) {
1011+
hostPatchProp(
1012+
el,
1013+
key,
1014+
oldProps[key],
1015+
null,
1016+
isSVG,
1017+
vnode.children as VNode[],
1018+
parentComponent,
1019+
parentSuspense,
1020+
unmountChildren
1021+
)
1022+
}
1023+
}
1024+
}
10081025
for (const key in newProps) {
10091026
// empty string is not valid prop
10101027
if (isReservedProp(key)) continue
@@ -1025,23 +1042,6 @@ function baseCreateRenderer(
10251042
)
10261043
}
10271044
}
1028-
if (oldProps !== EMPTY_OBJ) {
1029-
for (const key in oldProps) {
1030-
if (!isReservedProp(key) && !(key in newProps)) {
1031-
hostPatchProp(
1032-
el,
1033-
key,
1034-
oldProps[key],
1035-
null,
1036-
isSVG,
1037-
vnode.children as VNode[],
1038-
parentComponent,
1039-
parentSuspense,
1040-
unmountChildren
1041-
)
1042-
}
1043-
}
1044-
}
10451045
if ('value' in newProps) {
10461046
hostPatchProp(el, 'value', oldProps.value, newProps.value)
10471047
}

0 commit comments

Comments
 (0)