-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
attributeBinding for booleans broken in 2.7 #14024
Comments
@vcipriani I believe that is the desired behavior for boolean attributes in HTML, See http://www.w3.org/TR/html5/infrastructure.html#boolean-attributes I do not believe this is a bug. |
I agree with @pixelhandler. If you do want |
Given the answers by @pixelhandler and @rwjblue, I'm closing this as not a bug. Thank you everybody! |
I should have referenced this earlier, but the Ember documentation specifies the behavior we expected.
Its easy enough to use a string, so I don't mind, but it seems like the docs should be updated and this should be noted as a change. |
This broke a few of our tests that were using The new behavior is definitely preferable (and, as @pixelhandler mentioned, correct), but it was surprising to discover, particularly since there was no mention in the changelog or release announcement. |
Reopening for tracking the documentation change. Thank you! |
From [HTML5, A vocabulary and associated APIs for HTML and XHTML](https://www.w3.org/TR/html5/infrastructure.html#boolean-attributes): A number of attributes are boolean attributes. The presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value. **Note:** The values "true" and "false" are not allowed on boolean attributes. To represent a false value, the attribute has to be omitted altogether. Fixes emberjs#14024
Was wondering if anyone has built a patch for this to behave as it used to? |
No, but you can do so easily casting the boolean to a string in your function. |
From [HTML5, A vocabulary and associated APIs for HTML and XHTML](https://www.w3.org/TR/html5/infrastructure.html#boolean-attributes): A number of attributes are boolean attributes. The presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value. **Note:** The values "true" and "false" are not allowed on boolean attributes. To represent a false value, the attribute has to be omitted altogether. Fixes #14024 (cherry picked from commit 5d2175a)
From [HTML5, A vocabulary and associated APIs for HTML and XHTML](https://www.w3.org/TR/html5/infrastructure.html#boolean-attributes): A number of attributes are boolean attributes. The presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value. **Note:** The values "true" and "false" are not allowed on boolean attributes. To represent a false value, the attribute has to be omitted altogether. Fixes #14024 (cherry picked from commit 5d2175a)
From [HTML5, A vocabulary and associated APIs for HTML and XHTML](https://www.w3.org/TR/html5/infrastructure.html#boolean-attributes): A number of attributes are boolean attributes. The presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value. **Note:** The values "true" and "false" are not allowed on boolean attributes. To represent a false value, the attribute has to be omitted altogether. Fixes emberjs#14024
From [HTML5, A vocabulary and associated APIs for HTML and XHTML](https://www.w3.org/TR/html5/infrastructure.html#boolean-attributes): A number of attributes are boolean attributes. The presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value. **Note:** The values "true" and "false" are not allowed on boolean attributes. To represent a false value, the attribute has to be omitted altogether. Fixes emberjs#14024
In earlier versions, view attribute binding for boolean properties would have generated a tag similar to below:
<div id="ember444" bindingval="true" class="ember-view">
Now it is not displaying the attribute at all if false and doing the following if true
<div id="ember444" bindingval class="ember-view">
This can be verified by creating a brand new app and rendering a simple component setup like below.
The text was updated successfully, but these errors were encountered: