Skip to content

Commit

Permalink
fix(runtime-dom): avoid always resetting nullish option value
Browse files Browse the repository at this point in the history
close #10396
  • Loading branch information
yyx990803 committed Feb 25, 2024
1 parent 6bef15f commit ff130c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/runtime-dom/src/modules/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export function patchDOMProp(
el._value = value
// #4956: <option> value will fallback to its text content so we need to
// compare against its attribute value instead.
const oldValue = tag === 'OPTION' ? el.getAttribute('value') : el.value
const oldValue =
tag === 'OPTION' ? el.getAttribute('value') || '' : el.value
const newValue = value == null ? '' : value
if (oldValue !== newValue) {
el.value = newValue
Expand Down

0 comments on commit ff130c4

Please sign in to comment.