Skip to content

compat: ATTR_FALSE_VALUE incorrectly removes value attribute on inputs #13205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
markrian opened this issue Apr 15, 2025 · 0 comments · May be fixed by #13216
Open

compat: ATTR_FALSE_VALUE incorrectly removes value attribute on inputs #13205

markrian opened this issue Apr 15, 2025 · 0 comments · May be fixed by #13216
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: v2 compat

Comments

@markrian
Copy link

markrian commented Apr 15, 2025

Vue version

@vue/compat@3.5.13

Link to minimal reproduction

https://codepen.io/markrian/pen/NPPKOqm

Steps to reproduce

  1. Use @vue/compat with the ATTR_VALUE_FALSE compat flag enabled.
  2. Bind a false value to an input's value attribute.
  3. Note that the value attribute is removed from the input.
  4. If it's a type=text input, the value property is correctly coerced to "false".
  5. 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:

@markrian 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
@edison1105 edison1105 added 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: v2 compat labels Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: v2 compat
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants