-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Closed
Labels
🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.scope: v2 compat
Description
Vue version
@vue/[email protected]
Link to minimal reproduction
https://codepen.io/markrian/pen/NPPKOqm
Steps to reproduce
- Use
@vue/compatwith theATTR_VALUE_FALSEcompat flag enabled. - Bind a
falsevalue to an input'svalueattribute. - Note that the
valueattribute is removed from the input. - If it's a type=text input, the
valueproperty is correctly coerced to"false". - If it's a type=hidden input, the
valueproperty 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/AAny 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:
Metadata
Metadata
Assignees
Labels
🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.scope: v2 compat