Explore removing boolean attribute string value changes #4114
Comments
1 of 3 tasks
For more context, previous disussion on the topic: #2946. |
This was referenced Jun 20, 2021
This was referenced Jun 27, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Our boolean attribute handling tries to keep boolean attribute values valid according to the spec, by always setting the lowercased attribute name regardless of what value was set. However, we do this for all elements whether the boolean attribute is valid on that element or not. This is especially troublesome for custom elements.
Rather than checking the nodeName of the element to ensure the boolean attribute applies to that element, it may be doable to just allow any string through. It may not be technically valid, but I think it works in all browsers to set any string. We'd still want to keep the special handling for the value
false
(i.e. remove the attribute rather than set"false"
, which is actuallytrue
). Note that the string"false"
would still be passed through.Link to test case
See angular/angular.js#16602 (comment) for background.
The text was updated successfully, but these errors were encountered: