@@ -9,9 +9,8 @@ All of the attributes that can be used with normal `<input>` and `<textarea>` el
99on elements inside ` <mat-form-field> ` as well. This includes Angular directives such as ` ngModel `
1010and ` formControl ` .
1111
12- The only limitations are that the ` type ` attribute can only be one of the values supported by
13- ` matInput ` and the native element cannot specify a ` placeholder ` attribute if the ` <mat-form-field> `
14- also contains an ` <mat-placeholder> ` element.
12+ The only limitation is that the ` type ` attribute can only be one of the values supported by
13+ ` matInput ` .
1514
1615### Supported ` <input> ` types
1716
@@ -40,12 +39,11 @@ additional information about these features, see the
4039
4140### Placeholder
4241
43- A placeholder is a text label displayed in the input area when the input does not contain text.
44- When text is present, the placeholder will float above the input area. The placeholder can be
45- specified either via a ` placeholder ` attribute on the input or a ` <mat-placeholder> ` element in the
46- same form field as the ` matInput ` . The ` <mat-form-field> ` also has additional options for changing
47- the behavior of the placeholder. For more information see the
48- [ form field placeholder documentation] ( https://material.angular.io/components/form-field/overview#floating-placeholder ) .
42+ The placeholder is text shown when the ` <mat-form-field> ` label is floating but the input is empty.
43+ It is used to give the user an additional hint about what they should type in the input. The
44+ placeholder can be specified by setting the ` placeholder ` attribute on the ` <input> ` or ` <textarea> `
45+ element. In some cases that ` <mat-form-field> ` may use the placeholder as the label (see the
46+ [ form field label documentation] ( https://material.angular.io/components/form-field/overview#floating-label ) ).
4947
5048### Changing when error messages are shown
5149
@@ -90,10 +88,9 @@ for detecting when an input becomes autofilled and changing the appearance of th
9088
9189The ` matInput ` directive works with native ` <input> ` to provide an accessible experience.
9290
93- If a placeholder attribute is added to the input, or a ` mat-placeholder ` element is added
94- in the form field, the placeholder text will automatically be used as the label for the input.
95- If there's no placeholder specified, ` aria-label ` , ` aria-labelledby ` or ` <label for=...> ` should be
96- added.
91+ If the containing ` <mat-form-field> ` has a label it will automatically be used as the ` aria-label `
92+ for the ` <input> ` . However, if there's no label specified in the form field, ` aria-label ` ,
93+ ` aria-labelledby ` or ` <label for=...> ` should be added.
9794
9895Any ` mat-error ` and ` mat-hint ` are automatically added to the input's ` aria-describedby ` list, and
9996` aria-invalid ` is automatically updated based on the input's validity state.
0 commit comments