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"

0 commit comments

Comments
 (0)