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
  • Loading branch information
yyx990803 authored and OnlyWick committed Feb 27, 2024
1 parent 52844f6 commit 839517c
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 839517c

Please sign in to comment.