You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use @vue/compat with the ATTR_VALUE_FALSE compat flag enabled.
Bind a false value to an input's value attribute.
Note that the value attribute is removed from the input.
If it's a type=text input, the value property is correctly coerced to "false".
If it's a type=hidden input, the value property in incorrectly coerced to "".
What is expected?
The ATTR_VALUE_FALSE should not affect behaviour of inputs that's consistently across Vue 2.x and Vue 3.x.
What is actually happening?
The ATTR_VALUE_FALSE is overzealous and also drops falsy value attributes on inputs.
System Info
N/A
Any additional comments?
Note that both Vue 2.7.16 and Vue 3.5.13 behave the same way - the expected way. It's only the compat build with the ATTR_FALSE_VALUE flag that isn't behaving as expected:
The text was updated successfully, but these errors were encountered:
markrian
changed the title
ATTR_FALSE_VALUE incorrectly removes value attribute on inputs
compat: ATTR_FALSE_VALUE incorrectly removes value attribute on inputs
Apr 15, 2025
Vue version
@vue/[email protected]
Link to minimal reproduction
https://codepen.io/markrian/pen/NPPKOqm
Steps to reproduce
@vue/compat
with theATTR_VALUE_FALSE
compat flag enabled.false
value to an input'svalue
attribute.value
attribute is removed from the input.value
property is correctly coerced to"false"
.value
property in incorrectly coerced to""
.What is expected?
The
ATTR_VALUE_FALSE
should not affect behaviour of inputs that's consistently across Vue 2.x and Vue 3.x.What is actually happening?
The
ATTR_VALUE_FALSE
is overzealous and also drops falsyvalue
attributes on inputs.System Info
Any additional comments?
Note that both Vue 2.7.16 and Vue 3.5.13 behave the same way - the expected way. It's only the compat build with the
ATTR_FALSE_VALUE
flag that isn't behaving as expected:[email protected]
[email protected]
The text was updated successfully, but these errors were encountered: