SIGN IN SIGN UP
angular / angular.js UNCLAIMED

AngularJS - HTML enhanced for web apps!

0 0 0 JavaScript

feat(jqLite): don't remove a boolean attribute for .attr(attrName, '')

This change aligns jqLite with jQuery.

Ref #15126

BREAKING CHANGE: Before, using the `attr` method with an empty string as a value
would remove the boolean attribute. Now it sets it to its lowercase name as
was happening for every non-empty string so far. The only two values that remove
the boolean attribute are now null & false, just like in jQuery.

To migrate the code follow the example below:

Before:

elem.attr(booleanAttrName, '');

After:

elem.attr(booleanAttrName, false);

or:

elem.attr(booleanAttrName, null);
M
Michał Gołębiowski committed
3faf4505732758165083c9d21de71fa9b6983f4a
Parent: 4e36245