AngularJS's ng-disabled doesn't remove "disabled" attribute when jquery is loaded #4249
I'm submitting a ...
Expected / new behavior:
Minimal reproduction of the problem with instructions:
AngularJS version: 1.7.5 (or whatever your server currently ships)
Browser: all? (tested in chrome 70.0.3538.110 | Firefox 60.3.0esr)
This was already submitted to angularJS but they say it is the fault of jquery: angular/angular.js#16778
The text was updated successfully, but these errors were encountered:
@charlemagnelasse A jQuery-only version is needed for us to confirm there's an issue lying on the jQuery side.
An even simpler test case: https://next.plnkr.co/edit/MFIiCjoCv4k3sOPA
The issue lies in https://github.com/jquery/jquery/blob/3.3.1/src/attributes/attr.js#L44 where XML nodes are explicitly excluded from
@timmywil It's not clear to me from that old ticket description why it's more important in XML documents to be able to set boolean attribute values to any value than in regular HTML documents. Do you remember the reasons?
From what I understand the original issue wanted to set those attrs on a custom node where they don't have special meaning. That could be achieved by changing boolean attrs logic to account for the
Any change we do related to such old code will need to be treated as a breaking change and so will need to wait for 4.0.
One related issue from the past: #2946.
@jbedard I think AngularJS could be changed to invoke
We document that
Here's the way I remember it. The
This was 7 years ago so bear with me if I misremember some details. I'll attempt to explain.
The boolean hook is there both for back-compat-lots of code still out there with
Not even the strings "true" and "false" are technically allowed.
The point is simply to write valid DOM despite common, predictable misuse of the API.
An attribute in an XML document that happens to have the same name as a boolean attribute, such as
The original bug wasn't really related to XML exactly, but it did make me think of this distinction when the user tried to access what looked like boolean attributes on a custom tag. As @mgol said, the
The boolean setter hook remains in place to remove boolean attributes whenever someone tries to set
As for what changes to make, I'm not sure. It's my understanding that boolean attributes also have no special meaning or behavior in a pure XML document (which is different than XML in HTML), even on tags that happen to be named