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
The broad wording in a few places fails to draw attention to the fact that `:booleanAttr="false"` will be removed from markup, as in Vue 2. I added a few clarifications to make sure it's clear that this is specifically a change to non-boolean attributes.
I also removed the `low-level internal API change` label, because I think it is untrue that this won't affect most developers. HTML attributes changing from not being present to being present with a value of`"false"`, could easily have consequences, especially somewhat invisibly for screen-readers, for attributes like `aria-label`, `aria-labelledby`, `id`, etc
For instance: with a binding like `<label for="input">Email</label><input id="input" :aria-label="needsCustomAriaLabel && makeAriaLabel(input)">` the label of the input for a screenreader will change from "Email" to "false" between vue 2 and 3)
This is a low-level internal API change and does not affect most developers.
10
-
:::
11
-
12
8
## Overview
13
9
14
10
Here is a high level summary of the changes:
15
11
16
12
- Drop the internal concept of enumerated attributes and treat those attributes the same as normal non-boolean attributes
17
-
-**BREAKING**: No longer removes attribute if the value is boolean `false`. Instead, it's set as attr="false". To remove the attribute, use `null` or `undefined`.
13
+
-**BREAKING**: No longer removes non-boolean attribute if the value is boolean `false`. Instead, it's set as attr="false". To remove the attribute, use `null` or `undefined`. Handling of [boolean attributes](https://meiert.com/en/blog/boolean-attributes-of-html/) remain untouched.
18
14
19
15
For more information, read on!
20
16
@@ -30,7 +26,7 @@ In 2.x, we had the following strategies for coercing `v-bind` values:
30
26
31
27
- For other attributes, we remove "falsy" values (`undefined`, `null`, or `false`) and set other values as-is (see [here](https://github.com/vuejs/vue/blob/bad3c326a3f8b8e0d3bcf07917dc0adf97c32351/src/platforms/web/runtime/modules/attrs.js#L92-L113)).
32
28
33
-
The following table describes how Vue coerce "enumerated attributes" differently with normal non-boolean attributes:
29
+
The following table describes how Vue coerces "enumerated attributes" differently with normal non-boolean attributes:
0 commit comments