Skip to content

Commit 160a511

Browse files
mmalerbaandrewseguin
authored andcommitted
fix(form-field): remove 200px width since it messes up flex layouts (#7083)
* remove 200px width on form-field since it messes up flex layouts * fix select expanding to 100%
1 parent 4f571b1 commit 160a511

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/lib/form-field/_form-field-theme.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@
2323
$underline-color-warn: mat-color($warn);
2424
$underline-focused-color: mat-color($primary);
2525

26-
// Define the width here so that it is easier for users to override with one css class worth
27-
// of specificity.
28-
.mat-form-field {
29-
width: 200px;
30-
}
31-
3226
.mat-form-field-placeholder {
3327
color: $placeholder-color;
3428
}

src/lib/form-field/form-field.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
$mat-form-field-hint-min-space: 1em !default;
77
// The height of the underline.
88
$mat-form-field-underline-height: 1px !default;
9+
// Infix stretches to fit the container, but naturally wants to be this wide. We set this in order
10+
// to have a a consistent natural size for the various types of controls that can go in a form
11+
// field.
12+
$mat-form-field-default-infix-width: 180px !default;
913

1014

1115
.mat-form-field {
@@ -60,6 +64,7 @@ $mat-form-field-underline-height: 1px !default;
6064
position: relative;
6165
flex: auto;
6266
min-width: 0;
67+
width: $mat-form-field-default-infix-width;
6368
}
6469

6570
// Used to hide the placeholder overflow on IE, since IE doesn't take transform into account when

0 commit comments

Comments
 (0)