Skip to content

Commit 21b81d6

Browse files
authored
docs: explicitly set form field appearance (#22837)
Currently the default form field appearance is `legacy`, but we switch it to `fill` only in Stackblitz since that's what we want to change the default to eventually. The problem with this approach is that the default is only changed on Stackblitz, not the docs site that user has to go through. These changes set the appearance to `fill` explicitly so that it is consistent.
1 parent ade0901 commit 21b81d6

File tree

55 files changed

+107
-107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+107
-107
lines changed

src/components-examples/cdk/a11y/focus-monitor-focus-via/focus-monitor-focus-via-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<button #unmonitored>2. Not Monitored</button>
44
</div>
55

6-
<mat-form-field>
6+
<mat-form-field appearance="fill">
77
<mat-label>Simulated focus origin</mat-label>
88
<mat-select #simulatedOrigin value="mouse">
99
<mat-option value="mouse">Mouse</mat-option>

src/components-examples/cdk/text-field/text-field-autofill-directive/text-field-autofill-directive-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<form (submit)="$event.preventDefault()">
2-
<mat-form-field>
2+
<mat-form-field appearance="fill">
33
<mat-label>First name</mat-label>
44
<input matInput (cdkAutofill)="firstNameAutofilled = $event.isAutofilled">
55
<mat-hint *ngIf="firstNameAutofilled">Autofilled!</mat-hint>
66
</mat-form-field>
7-
<mat-form-field>
7+
<mat-form-field appearance="fill">
88
<mat-label>Last name</mat-label>
99
<input matInput (cdkAutofill)="lastNameAutofilled = $event.isAutofilled">
1010
<mat-hint *ngIf="lastNameAutofilled">Autofilled!</mat-hint>

src/components-examples/cdk/text-field/text-field-autofill-monitor/text-field-autofill-monitor-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<form (submit)="$event.preventDefault()">
2-
<mat-form-field>
2+
<mat-form-field appearance="fill">
33
<mat-label>First name</mat-label>
44
<input matInput #first>
55
<mat-hint *ngIf="firstNameAutofilled">Autofilled!</mat-hint>
66
</mat-form-field>
7-
<mat-form-field>
7+
<mat-form-field appearance="fill">
88
<mat-label>Last name</mat-label>
99
<input matInput #last>
1010
<mat-hint *ngIf="lastNameAutofilled">Autofilled!</mat-hint>

src/components-examples/cdk/text-field/text-field-autosize-textarea/text-field-autosize-textarea-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<mat-form-field>
1+
<mat-form-field appearance="fill">
22
<mat-label>Font size</mat-label>
33
<mat-select #fontSize value="16px" (selectionChange)="triggerResize()">
44
<mat-option value="10px">10px</mat-option>
@@ -10,7 +10,7 @@
1010
</mat-select>
1111
</mat-form-field>
1212

13-
<mat-form-field [style.fontSize]="fontSize.value">
13+
<mat-form-field [style.fontSize]="fontSize.value" appearance="fill">
1414
<mat-label>Autosize textarea</mat-label>
1515
<textarea matInput
1616
cdkTextareaAutosize

src/components-examples/material-experimental/mdc-form-field/mdc-form-field-custom-control/form-field-custom-control-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<mat-form-field>
1+
<mat-form-field appearance="fill">
22
<mat-label>Phone number</mat-label>
33
<example-tel-input required></example-tel-input>
44
<mat-icon matSuffix>phone</mat-icon>

src/components-examples/material-experimental/popover-edit/popover-edit-cell-span-mat-table/popover-edit-cell-span-mat-table-example.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
[matEditLensPreservedFormValue]="preservedValues.get(ctx.person)"
88
(matEditLensPreservedFormValueChange)="preservedValues.set(ctx.person, $event)">
99
<div mat-edit-content class="example-input-container">
10-
<mat-form-field>
10+
<mat-form-field appearance="fill">
1111
<input matInput [ngModel]="ctx.person.firstName" name="firstName" required
1212
[attr.cdkFocusInitial]="ctx.focus === 'firstName' || null">
1313
</mat-form-field>
14-
<mat-form-field>
14+
<mat-form-field appearance="fill">
1515
<input matInput [ngModel]="ctx.person.middleName" name="middleName"
1616
[attr.cdkFocusInitial]="ctx.focus === 'middleName' || null">
1717
</mat-form-field>
18-
<mat-form-field>
18+
<mat-form-field appearance="fill">
1919
<input matInput [ngModel]="ctx.person.lastName" name="lastName" required
2020
[attr.cdkFocusInitial]="ctx.focus === 'lastName' || null">
2121
</mat-form-field>

src/components-examples/material-experimental/popover-edit/popover-edit-mat-table-flex/popover-edit-mat-table-flex-example.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
[matEditLensPreservedFormValue]="preservedWeightValues.get(element)"
1212
(matEditLensPreservedFormValueChange)="preservedWeightValues.set(element, $event)">
1313
<div mat-edit-content>
14-
<mat-form-field>
14+
<mat-form-field appearance="fill">
1515
<input matInput type="number" [ngModel]="element.weight" name="weight" required>
1616
</mat-form-field>
1717
</div>
@@ -31,7 +31,7 @@
3131
<mat-cell *matCellDef="let element"
3232
[matPopoverEdit]="nameEdit">
3333
{{element.name}}
34-
34+
3535
<!-- This edit is defined in the cell and can implicitly access element -->
3636
<ng-template #nameEdit>
3737
<div>
@@ -42,7 +42,7 @@
4242
(matEditLensPreservedFormValueChange)="preservedNameValues.set(element, $event)">
4343
<h2 mat-edit-title>Name</h2>
4444
<div mat-edit-content>
45-
<mat-form-field>
45+
<mat-form-field appearance="fill">
4646
<input matInput [ngModel]="element.name" name="name" required>
4747
</mat-form-field>
4848
</div>
@@ -67,7 +67,7 @@ <h2 mat-edit-title>Name</h2>
6767
<mat-cell *matCellDef="let element"
6868
[matPopoverEdit]="weightEdit" [matPopoverEditContext]="element">
6969
{{element.weight}}
70-
70+
7171
<span *matRowHoverContent>
7272
<button mat-icon-button matEditOpen><mat-icon>edit</mat-icon></button>
7373
</span>

src/components-examples/material-experimental/popover-edit/popover-edit-mat-table/popover-edit-mat-table-example.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
(ngSubmit)="onSubmitWeight(element, f)"
1111
[(matEditLensPreservedFormValue)]="weightValues.for(element).value">
1212
<div mat-edit-content>
13-
<mat-form-field>
13+
<mat-form-field appearance="fill">
1414
<input matInput type="number" [ngModel]="element.weight" name="weight" required>
1515
</mat-form-field>
1616
</div>
@@ -47,7 +47,7 @@
4747
[matPopoverEdit]="nameEdit"
4848
[matPopoverEditDisabled]="!nameEditEnabled">
4949
{{element.name}}
50-
50+
5151
<!-- This edit is defined in the cell and can implicitly access element -->
5252
<ng-template #nameEdit>
5353
<div>
@@ -57,7 +57,7 @@
5757
[(matEditLensPreservedFormValue)]="nameValues.for(element).value">
5858
<h2 mat-edit-title>Name</h2>
5959
<div mat-edit-content>
60-
<mat-form-field>
60+
<mat-form-field appearance="fill">
6161
<input matInput [ngModel]="element.name" name="name" required>
6262
</mat-form-field>
6363
</div>
@@ -121,7 +121,7 @@ <h2 mat-edit-title>Name</h2>
121121
<td mat-cell *matCellDef="let element"
122122
[matPopoverEdit]="weightEdit" [matPopoverEditContext]="element">
123123
{{element.weight}}
124-
124+
125125
<span *matRowHoverContent>
126126
<button mat-icon-button matEditOpen><mat-icon>edit</mat-icon></button>
127127
</span>

src/components-examples/material-experimental/popover-edit/popover-edit-tab-out-mat-table/popover-edit-tab-out-mat-table-example.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
[matEditLensPreservedFormValue]="preservedWeightValues.get(element)"
1313
(matEditLensPreservedFormValueChange)="preservedWeightValues.set(element, $event)">
1414
<div mat-edit-content>
15-
<mat-form-field>
15+
<mat-form-field appearance="fill">
1616
<input matInput type="number" [ngModel]="element.weight" name="weight" required>
1717
</mat-form-field>
1818
</div>
@@ -33,7 +33,7 @@
3333
[matPopoverEdit]="nameEdit" matPopoverEditTabOut
3434
matEditOpen>
3535
{{element.name}}
36-
36+
3737
<!-- This edit is defined in the cell and can implicitly access element -->
3838
<ng-template #nameEdit>
3939
<div>
@@ -44,7 +44,7 @@
4444
[matEditLensPreservedFormValue]="preservedNameValues.get(element)"
4545
(matEditLensPreservedFormValueChange)="preservedNameValues.set(element, $event)">
4646
<div mat-edit-content>
47-
<mat-form-field>
47+
<mat-form-field appearance="fill">
4848
<input matInput [ngModel]="element.name" name="name" required>
4949
</mat-form-field>
5050
</div>
@@ -66,7 +66,7 @@
6666
[matPopoverEditContext]="element"
6767
matEditOpen>
6868
{{element.weight}}
69-
69+
7070
<span *matRowHoverContent>
7171
<mat-icon>edit</mat-icon>
7272
</span>

src/components-examples/material/autocomplete/autocomplete-auto-active-first-option/autocomplete-auto-active-first-option-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<form class="example-form">
2-
<mat-form-field class="example-full-width">
2+
<mat-form-field class="example-full-width" appearance="fill">
33
<mat-label>Number</mat-label>
44
<input type="text"
55
placeholder="Pick one"

src/components-examples/material/autocomplete/autocomplete-display/autocomplete-display-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<form class="example-form">
2-
<mat-form-field class="example-full-width">
2+
<mat-form-field class="example-full-width" appearance="fill">
33
<mat-label>Assignee</mat-label>
44
<input type="text" matInput [formControl]="myControl" [matAutocomplete]="auto">
55
<mat-autocomplete #auto="matAutocomplete" [displayWith]="displayFn">

src/components-examples/material/autocomplete/autocomplete-filter/autocomplete-filter-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<form class="example-form">
2-
<mat-form-field class="example-full-width">
2+
<mat-form-field class="example-full-width" appearance="fill">
33
<mat-label>Number</mat-label>
44
<input type="text"
55
placeholder="Pick one"

src/components-examples/material/autocomplete/autocomplete-optgroup/autocomplete-optgroup-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<form [formGroup]="stateForm">
2-
<mat-form-field>
2+
<mat-form-field appearance="fill">
33
<mat-label>States Group</mat-label>
44
<input type="text"
55
matInput

src/components-examples/material/autocomplete/autocomplete-overview/autocomplete-overview-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<form class="example-form">
2-
<mat-form-field class="example-full-width">
2+
<mat-form-field class="example-full-width" appearance="fill">
33
<mat-label>State</mat-label>
44
<input matInput
55
aria-label="State"

src/components-examples/material/autocomplete/autocomplete-simple/autocomplete-simple-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<form class="example-form">
2-
<mat-form-field class="example-full-width">
2+
<mat-form-field class="example-full-width" appearance="fill">
33
<mat-label>Number</mat-label>
44
<!-- #docregion input -->
55
<input type="text"

src/components-examples/material/chips/chips-autocomplete/chips-autocomplete-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<mat-form-field class="example-chip-list">
1+
<mat-form-field class="example-chip-list" appearance="fill">
22
<mat-label>Favorite Fruits</mat-label>
33
<mat-chip-list #chipList aria-label="Fruit selection">
44
<mat-chip

src/components-examples/material/chips/chips-form-control/chips-form-control-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Selected keywords: {{formControl.value}}
88
</p>
99

10-
<mat-form-field class="example-chip-list">
10+
<mat-form-field class="example-chip-list" appearance="fill">
1111
<mat-label>Video keywords</mat-label>
1212
<mat-chip-list #chipList aria-label="Video keywords" multiple [formControl]="formControl">
1313
<mat-chip

src/components-examples/material/chips/chips-input/chips-input-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<mat-form-field class="example-chip-list">
1+
<mat-form-field class="example-chip-list" appearance="fill">
22
<mat-label>Favorite Fruits</mat-label>
33
<mat-chip-list #chipList aria-label="Fruit selection">
44
<mat-chip *ngFor="let fruit of fruits" [selectable]="selectable"

src/components-examples/material/core/ripple-overview/ripple-overview-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<mat-checkbox [(ngModel)]="disabled" class="example-ripple-checkbox">Disabled</mat-checkbox>
33
<mat-checkbox [(ngModel)]="unbounded" class="example-ripple-checkbox">Unbounded</mat-checkbox>
44

5-
<mat-form-field class="example-ripple-form-field">
5+
<mat-form-field class="example-ripple-form-field" appearance="fill">
66
<input matInput [(ngModel)]="radius" type="number" placeholder="Radius">
77
</mat-form-field>
8-
<mat-form-field class="example-ripple-form-field">
8+
<mat-form-field class="example-ripple-form-field" appearance="fill">
99
<input matInput [(ngModel)]="color" type="text" placeholder="Color">
1010
</mat-form-field>
1111

src/components-examples/material/dialog/dialog-overview/dialog-overview-example-dialog.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<h1 mat-dialog-title>Hi {{data.name}}</h1>
22
<div mat-dialog-content>
33
<p>What's your favorite animal?</p>
4-
<mat-form-field>
4+
<mat-form-field appearance="fill">
55
<mat-label>Favorite Animal</mat-label>
66
<input matInput [(ngModel)]="data.animal">
77
</mat-form-field>

src/components-examples/material/dialog/dialog-overview/dialog-overview-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<ol>
22
<li>
3-
<mat-form-field>
3+
<mat-form-field appearance="fill">
44
<mat-label>What's your name?</mat-label>
55
<input matInput [(ngModel)]="name">
66
</mat-form-field>

src/components-examples/material/expansion/expansion-expand-collapse-all/expansion-expand-collapse-all-example.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
</mat-panel-description>
1717
</mat-expansion-panel-header>
1818

19-
<mat-form-field>
19+
<mat-form-field appearance="fill">
2020
<mat-label>First name</mat-label>
2121
<input matInput>
2222
</mat-form-field>
2323

24-
<mat-form-field>
24+
<mat-form-field appearance="fill">
2525
<mat-label>Age</mat-label>
2626
<input matInput type="number" min="1">
2727
</mat-form-field>
@@ -40,7 +40,7 @@
4040
</mat-panel-description>
4141
</mat-expansion-panel-header>
4242

43-
<mat-form-field>
43+
<mat-form-field appearance="fill">
4444
<mat-label>Country</mat-label>
4545
<input matInput>
4646
</mat-form-field>
@@ -57,7 +57,7 @@
5757
</mat-panel-description>
5858
</mat-expansion-panel-header>
5959

60-
<mat-form-field>
60+
<mat-form-field appearance="fill">
6161
<mat-label>Date</mat-label>
6262
<input matInput [matDatepicker]="picker" (focus)="picker.open()" readonly>
6363
</mat-form-field>

src/components-examples/material/expansion/expansion-steps/expansion-steps-example.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
</mat-panel-description>
1111
</mat-expansion-panel-header>
1212

13-
<mat-form-field>
13+
<mat-form-field appearance="fill">
1414
<mat-label>First name</mat-label>
1515
<input matInput>
1616
</mat-form-field>
1717

18-
<mat-form-field>
18+
<mat-form-field appearance="fill">
1919
<mat-label>Age</mat-label>
2020
<input matInput type="number" min="1">
2121
</mat-form-field>
@@ -37,7 +37,7 @@
3737
</mat-panel-description>
3838
</mat-expansion-panel-header>
3939

40-
<mat-form-field>
40+
<mat-form-field appearance="fill">
4141
<mat-label>Country</mat-label>
4242
<input matInput>
4343
</mat-form-field>
@@ -59,7 +59,7 @@
5959
</mat-panel-description>
6060
</mat-expansion-panel-header>
6161

62-
<mat-form-field>
62+
<mat-form-field appearance="fill">
6363
<mat-label>Date</mat-label>
6464
<input matInput [matDatepicker]="picker" (focus)="picker.open()" readonly>
6565
</mat-form-field>

src/components-examples/material/input/input-clearable/input-clearable-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<mat-form-field class="example-form-field">
1+
<mat-form-field class="example-form-field" appearance="fill">
22
<mat-label>Clearable input</mat-label>
33
<input matInput type="text" [(ngModel)]="value">
44
<button *ngIf="value" matSuffix mat-icon-button aria-label="Clear" (click)="value=''">

src/components-examples/material/input/input-error-state-matcher/input-error-state-matcher-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<form class="example-form">
2-
<mat-form-field class="example-full-width">
2+
<mat-form-field class="example-full-width" appearance="fill">
33
<mat-label>Email</mat-label>
44
<input type="email" matInput [formControl]="emailFormControl" [errorStateMatcher]="matcher"
55
placeholder="Ex. [email protected]">

src/components-examples/material/input/input-errors/input-errors-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<form class="example-form">
2-
<mat-form-field class="example-full-width">
2+
<mat-form-field class="example-full-width" appearance="fill">
33
<mat-label>Email</mat-label>
44
<input type="email" matInput [formControl]="emailFormControl" placeholder="Ex. [email protected]">
55
<mat-error *ngIf="emailFormControl.hasError('email') && !emailFormControl.hasError('required')">

0 commit comments

Comments
 (0)