Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 24ddbaf

Browse files
gscoppinoNarretz
authored andcommitted
docs(guide/Internet Explorer Compatibility): include warnings for usage of 'disabled' attribute
* docs(guide/Internet Explorer Compatibility): Mention 'disabled' attribute Setting the 'disabled' attribute on an element that has descendant elements has unexpected behavior in Internet Explorer 11. * Input elements that are descendants have the text content of the 'placeholder' attribute inserted as the value (and it is not removed when typing in the field). * Select elements that are descendants are disabled. To avoid this issue, it is important to not set `disabled` or `ng-disabled` on an element that has descendant form elements. Normally these should only be used on actual form controls so the issue would not manifest. The issue can also appear if a directive/component is named 'disabled' or takes an attribute named 'disabled' as an input/output attribute, so avoid these. Closes #16490 Related #15700
1 parent 980b69d commit 24ddbaf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/content/guide/ie.ngdoc

+9
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,12 @@ To ensure your AngularJS application works on IE please consider:
3939
of `placeholder="{{ someExpression }}"`. If using the latter, Internet Explorer will error
4040
on accessing the `nodeValue` on a parentless `TextNode` in Internet Explorer 10 & 11
4141
(see [issue 5025](https://github.com/angular/angular.js/issues/5025)).
42+
5. Using the `disabled` attribute on an element that has
43+
descendant form controls can result in unexpected behavior in Internet Explorer 11.
44+
For example, the value of descendant input elements with `ng-model` will not reflect
45+
the model (or changes to the model), and the value of the `placeholder` attribute will be
46+
inserted as the input's value. Descendant select elements will also be inoperable, as if they
47+
had the `disabled` attribute applied to them, which may not be the intended effect.
48+
To work around this unexpected behavior, 1) avoid using the identifier `disabled` for custom attribute
49+
directives that are on elements with descendant form controls, and 2) avoid using `disabled` as an identifier
50+
for an attribute passed to a custom directive that has descendant form controls.

0 commit comments

Comments
 (0)