We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b608a9 commit fbb9d85Copy full SHA for fbb9d85
packages/runtime-dom/src/modules/props.ts
@@ -32,7 +32,14 @@ export function patchDOMProp(
32
// compare against its attribute value instead.
33
const oldValue =
34
tag === 'OPTION' ? el.getAttribute('value') || '' : el.value
35
- const newValue = value == null ? '' : String(value)
+ const newValue =
36
+ value == null
37
+ ? // #11647: value should be set as empty string for null and undefined,
38
+ // but <input type="checkbox"> should be set as 'no'.
39
+ el.type === 'checkbox'
40
+ ? 'on'
41
+ : ''
42
+ : String(value)
43
if (oldValue !== newValue || !('_value' in el)) {
44
el.value = newValue
45
}
0 commit comments