Skip to content

Commit 8147cc9

Browse files
authored
docs(select): switch examples to fill appearance (#19708)
Changes all of the `mat-select` examples to use a `mat-form-field` appearance that won't be deprecated in the future.
1 parent ab74abe commit 8147cc9

File tree

14 files changed

+23
-23
lines changed

14 files changed

+23
-23
lines changed

src/components-examples/material/select/select-custom-trigger/select-custom-trigger-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>Toppings</mat-label>
33
<mat-select [formControl]="toppings" multiple>
44
<mat-select-trigger>

src/components-examples/material/select/select-disabled/select-disabled-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
</p>
44

55
<h4>mat-select</h4>
6-
<mat-form-field>
6+
<mat-form-field appearance="fill">
77
<mat-label>Choose an option</mat-label>
88
<mat-select [disabled]="disableSelect.value">
99
<mat-option value="option1">Option 1</mat-option>
@@ -13,7 +13,7 @@ <h4>mat-select</h4>
1313
</mat-form-field>
1414

1515
<h4>native html select</h4>
16-
<mat-form-field>
16+
<mat-form-field appearance="fill">
1717
<mat-label>Choose an option</mat-label>
1818
<select matNativeControl [disabled]="disableSelect.value">
1919
<option value="" selected></option>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h4>mat-select</h4>
2-
<mat-form-field>
2+
<mat-form-field appearance="fill">
33
<mat-label>Choose one</mat-label>
44
<mat-select [formControl]="selected" [errorStateMatcher]="matcher">
55
<mat-option>Clear</mat-option>
@@ -14,7 +14,7 @@ <h4>mat-select</h4>
1414
</mat-form-field>
1515

1616
<h4>native html select</h4>
17-
<mat-form-field class="demo-full-width">
17+
<mat-form-field class="demo-full-width" appearance="fill">
1818
<mat-label>Choose one</mat-label>
1919
<select matNativeControl [formControl]="nativeSelectFormControl" [errorStateMatcher]="matcher">
2020
<option value=""></option>

src/components-examples/material/select/select-form/select-form-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<form>
22
<h4>mat-select</h4>
3-
<mat-form-field>
3+
<mat-form-field appearance="fill">
44
<mat-label>Favorite food</mat-label>
55
<mat-select [(ngModel)]="selectedValue" name="food">
66
<mat-option *ngFor="let food of foods" [value]="food.value">
@@ -10,7 +10,7 @@ <h4>mat-select</h4>
1010
</mat-form-field>
1111
<p> Selected food: {{selectedValue}} </p>
1212
<h4>native html select</h4>
13-
<mat-form-field>
13+
<mat-form-field appearance="fill">
1414
<mat-label>Favorite car</mat-label>
1515
<select matNativeControl [(ngModel)]="selectedCar" name="car">
1616
<option value="" selected></option>

src/components-examples/material/select/select-hint-error/select-hint-error-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h4>mat select</h4>
2-
<mat-form-field>
2+
<mat-form-field appearance="fill">
33
<mat-label>Favorite animal</mat-label>
44
<mat-select [formControl]="animalControl" required>
55
<mat-option>--</mat-option>
@@ -12,7 +12,7 @@ <h4>mat select</h4>
1212
</mat-form-field>
1313

1414
<h4>native html select</h4>
15-
<mat-form-field>
15+
<mat-form-field appearance="fill">
1616
<mat-label>Select your car (required)</mat-label>
1717
<select matNativeControl required [formControl]="selectFormControl">
1818
<option label="--select something --"></option>

src/components-examples/material/select/select-initial-value/select-initial-value-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h4>Basic mat-select with initial value</h4>
2-
<mat-form-field>
2+
<mat-form-field appearance="fill">
33
<mat-label>Favorite Food</mat-label>
44
<mat-select [(value)]="selectedFood">
55
<mat-option></mat-option>
@@ -9,7 +9,7 @@ <h4>Basic mat-select with initial value</h4>
99
<p>You selected: {{selectedFood}}</p>
1010

1111
<h4>Basic native select with initial value</h4>
12-
<mat-form-field>
12+
<mat-form-field appearance="fill">
1313
<mat-label>Favorite Car</mat-label>
1414
<select matNativeControl (change)="selectCar($event)">
1515
<option value=""></option>

src/components-examples/material/select/select-multiple/select-multiple-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>Toppings</mat-label>
33
<mat-select [formControl]="toppings" multiple>
44
<mat-option *ngFor="let topping of toppingList" [value]="topping">{{topping}}</mat-option>

src/components-examples/material/select/select-no-ripple/select-no-ripple-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>Select an option</mat-label>
33
<mat-select disableRipple>
44
<mat-option value="1">Option 1</mat-option>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h4>mat-select</h4>
2-
<mat-form-field>
2+
<mat-form-field appearance="fill">
33
<mat-label>Pokemon</mat-label>
44
<mat-select [formControl]="pokemonControl">
55
<mat-option>-- None --</mat-option>
@@ -13,7 +13,7 @@ <h4>mat-select</h4>
1313
</mat-form-field>
1414

1515
<h4>native html select</h4>
16-
<mat-form-field>
16+
<mat-form-field appearance="fill">
1717
<mat-label>Cars</mat-label>
1818
<select matNativeControl>
1919
<optgroup label="Swedish Cars">

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h4>Basic mat-select</h4>
2-
<mat-form-field>
2+
<mat-form-field appearance="fill">
33
<mat-label>Favorite food</mat-label>
44
<mat-select>
55
<mat-option *ngFor="let food of foods" [value]="food.value">
@@ -9,7 +9,7 @@ <h4>Basic mat-select</h4>
99
</mat-form-field>
1010

1111
<h4>Basic native select</h4>
12-
<mat-form-field>
12+
<mat-form-field appearance="fill">
1313
<mat-label>Cars</mat-label>
1414
<select matNativeControl required>
1515
<option value="volvo">Volvo</option>

src/components-examples/material/select/select-panel-class/select-panel-class-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>Panel color</mat-label>
33
<mat-select [formControl]="panelColor"
44
panelClass="example-panel-{{panelColor.value}}">

src/components-examples/material/select/select-reactive-form/select-reactive-form-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<form [formGroup]="form">
22
<h4>mat-select</h4>
3-
<mat-form-field>
3+
<mat-form-field appearance="fill">
44
<mat-label>Favorite Food</mat-label>
55
<mat-select [formControl]="foodControl" name="food">
66
<mat-option>None</mat-option>
@@ -11,7 +11,7 @@ <h4>mat-select</h4>
1111
</mat-form-field>
1212
<p>Selected: {{foodControl.value}}</p>
1313
<h4>Native select</h4>
14-
<mat-form-field>
14+
<mat-form-field appearance="fill">
1515
<mat-label>Favorite Car</mat-label>
1616
<select matNativeControl [formControl]="carControl" name="car">
1717
<option value="">None</option>

src/components-examples/material/select/select-reset/select-reset-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h4>mat-select</h4>
2-
<mat-form-field>
2+
<mat-form-field appearance="fill">
33
<mat-label>State</mat-label>
44
<mat-select>
55
<mat-option>None</mat-option>
@@ -8,7 +8,7 @@ <h4>mat-select</h4>
88
</mat-form-field>
99

1010
<h4>native html select</h4>
11-
<mat-form-field>
11+
<mat-form-field appearance="fill">
1212
<mat-label>Select your car</mat-label>
1313
<select matNativeControl id="mySelectId">
1414
<option value="" disabled selected></option>

src/components-examples/material/select/select-value-binding/select-value-binding-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>Select an option</mat-label>
33
<mat-select [(value)]="selected">
44
<mat-option>None</mat-option>

0 commit comments

Comments
 (0)