Skip to content

Commit 6c05821

Browse files
committed
fix slight error in multi-select dropdown placement
1 parent 1030687 commit 6c05821

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

src/lib/core/option/_option.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@
2828
}
2929
}
3030

31+
// Collapses unwanted whitespace created by newlines in code like the following:
32+
// <md-option>
33+
// {{value}}
34+
// </md-option>
35+
.mat-option-text {
36+
display: inline-block;
37+
}
38+
3139
.mat-option-ripple {
3240
position: absolute;
3341
top: 0;

src/lib/core/option/option.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
[state]="selected ? 'checked' : ''"></md-pseudo-checkbox>
66
</span>
77

8-
<ng-content></ng-content>
8+
<span class="mat-option-text"><ng-content></ng-content></span>
9+
910
<div class="mat-option-ripple" md-ripple
1011
[mdRippleTrigger]="_getHostElement()"
1112
[mdRippleDisabled]="disabled || disableRipple">

src/lib/select/select.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,11 @@ export const SELECT_ITEM_HEIGHT_EM = 3;
8080
* Distance between the panel edge and the option text in
8181
* multi-selection mode.
8282
*
83-
* (SELECT_PADDING * 1.75) + 20 = 48
84-
* The padding is multiplied by 1.75 because the checkbox's margin is half the padding, and
85-
* the browser adds ~4px, because we're using inline elements.
83+
* (SELECT_PANEL_PADDING_X * 1.5) + 20 = 44
84+
* The padding is multiplied by 1.5 because the checkbox's margin is half the padding.
8685
* The checkbox width is 20px.
8786
*/
88-
export const SELECT_MULTIPLE_PANEL_PADDING_X = SELECT_PANEL_PADDING_X * 1.75 + 20;
87+
export const SELECT_MULTIPLE_PANEL_PADDING_X = SELECT_PANEL_PADDING_X * 1.5 + 20;
8988

9089
/**
9190
* The panel's padding on the y-axis. This padding indicates there are more

0 commit comments

Comments
 (0)