Skip to content

Commit ff130c4

Browse files
committedFeb 25, 2024·
fix(runtime-dom): avoid always resetting nullish option value
close #10396
1 parent 6bef15f commit ff130c4

File tree

1 file changed

+2
-1
lines changed
  • packages/runtime-dom/src/modules

1 file changed

+2
-1
lines changed
 

‎packages/runtime-dom/src/modules/props.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ export function patchDOMProp(
3939
el._value = value
4040
// #4956: <option> value will fallback to its text content so we need to
4141
// compare against its attribute value instead.
42-
const oldValue = tag === 'OPTION' ? el.getAttribute('value') : el.value
42+
const oldValue =
43+
tag === 'OPTION' ? el.getAttribute('value') || '' : el.value
4344
const newValue = value == null ? '' : value
4445
if (oldValue !== newValue) {
4546
el.value = newValue

0 commit comments

Comments
 (0)
Please sign in to comment.