Only warn against removeAttr(booleanAttr)
if property value not false
#471
Milestone
removeAttr(booleanAttr)
if property value not false
#471
Migrate warns against
.removeAttr()
called on boolean attributes as this used to set the associated property tofalse
but it doesn't do so anymore since jQuery 3.0.0.However, this is only an issue if the property wasn't already set to
false
. There are valid reasons to callremoveAttr
on boolean attributes and it shouldn't cause issues as long as the property is being updated first.This is not just a theoretical concern - AngularJS sets both boolean properties & then associated attributes, calling
removeAttr
if the value passed wasfalse
. See a report about that at angular/angular.js#16877. I also hit it at my employer when updating jQuery.The proposal is to read the property and if it's already
false
, skip the warning.The text was updated successfully, but these errors were encountered: