We are no longer accepting changes that are not critical bug fixes into this project.
See https://blog.angular.io/stable-angularjs-and-long-term-support-7e077635ee9c for more detail.
I'm submitting a ...
Current behavior:
jQuery migrate 3.0.1 shows warnings as "JQMIGRATE: jQuery.fn.removeAttr no longer sets boolean properties: disabled" with angular 1.7.6 to 1.7.8.
Expected / new behavior:
As per jQuery migrate documentation removeAttr should not be used. Instead .prop( "checked", false ) should be used.
https://github.com/jquery/jquery-migrate/blob/master/warnings.md
Minimal reproduction of the problem with instructions:
AngularJS version: 1.7.x
Yes this issue occurs with most recent version of angularjs 1.7.8.
Browser: [all | Chrome XX | Firefox XX | Edge XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView | Opera XX ]
Anything else:
Instead of using .removeAttr("checked") we can use .prop("checked", false)
This issue is related to the change
https://github.com/angular/angular.js/pull/16779
This issue only occurs if we include jQuery migrate in our application.
Closing the ticket as application works fine if we remove jQuery migrate.
@git-ram-pal Thanks for the report. While you closed it, I still wanted to provide some details here:
elem.attr(booleanAttr, false) is equivalent to elem.removeAttr(booleanAttr).prop method should be used instead of attr. Just using attr may not update some boolean properties properly. AngularJS updates the attributes but it also updates the properties. Therefore, we're already doing what Migrate advises to do here, we just also update attributes. Migrate cannot know we're doing both so it warns but this warning should be harmless.
Most helpful comment
@git-ram-pal Thanks for the report. While you closed it, I still wanted to provide some details here:
elem.attr(booleanAttr, false)is equivalent toelem.removeAttr(booleanAttr).propmethod should be used instead ofattr. Just usingattrmay not update some boolean properties properly. AngularJS updates the attributes but it also updates the properties. Therefore, we're already doing what Migrate advises to do here, we just also update attributes. Migrate cannot know we're doing both so it warns but this warning should be harmless.