Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Undesirable ng-attr-disabled behavior on custom elements #16602
I'm submitting a ...
I have defined a Custom Element that observes a
Expected / new behavior:
React has some similar issues affecting support for Web Components where it attempts to provide value to developers by throwing errors when standard HTML elements and attributes are used in invalid ways in JSX. My loose understanding is that React now checks for a hyphen, assumes any tag with hyphen in its name is a custom element, and goes down a different path without its potentially disruptive HTML validation behavior for those.
I think it might be preferable if
Especially since, without the draconian error handling of serving XHTML as XML (perhaps even with it, I don't recall, it's been so long), it really doesn't matter what the value is for any element. Strictly speaking, it's invalid, but practically speaking, you can write the HTML
Minimal reproduction of the problem with instructions:
AngularJS version: 1.6.7, 1.7.3
I get that this could be problematic since it's a change in how Angular has behaved for a long time. It's a pain for using Web Components with Angular as-is, however, because it's almost impossible to work around without changing the attribute name, since the behavior shows up in all of the following:
But there's no particular reason this attribute name should have to change. The best vocabulary choice is
A little background:
So, I would say it is reasonable to take the element into account in
It is possible to special-case
Discussed this and agreed this is an issue with jQuery. We decided it doesn't make sense to break compatiblity with jQuery atm. (If this is changed in jQuery in the future, we can reconsider.)
In the meantime, it is fairly straight forward to work around this by creating your own directive that set
Didn't think of that workaround, thanks! It necessitates more education and a habit change for consuming developers, but it'll certainly mitigate.
Do you think I should file this for jQuery? Do you happen to know if the maintainers/community are concerned about Web Component compatibility?