Skip to content

Commit 9ec0517

Browse files
committed
fix(select): change styling to always center select value text
1 parent 1a89a08 commit 9ec0517

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/lib/select/select.scss

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,16 @@ $mat-select-panel-max-height: 256px !default;
7474
// position. This has been fixed for Firefox 52, slated for early 2017.
7575
// Bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=874718
7676
//
77-
// In the meantime, we must adjust the left position to 0 to mimic where it
78-
// would be if it were correctly taken out of the flex flow. It's also necessary
79-
// to adjust the top value because absolutely positioned elements should not be
80-
// affected by the flex container's "align-items" property either. To center the text,
81-
// we must offset by 6px (6px top + 6px bottom + 18px text height = 30px total height).
77+
// In the meantime, we must adjust the position to fit the top and left edge of the
78+
// containing element with a height matching the trigger container.
79+
// In doing so, we can use align-items: center to allow the text to
80+
// correctly position itself in the middle of the container.
81+
top: 0;
8282
left: 0;
83-
top: 6px;
83+
height: $mat-select-trigger-height;
84+
85+
display: flex;
86+
align-items: center;
8487

8588
[dir='rtl'] & {
8689
left: auto;

0 commit comments

Comments
 (0)