File tree Expand file tree Collapse file tree 4 files changed +25
-9
lines changed Expand file tree Collapse file tree 4 files changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -18,13 +18,13 @@ export class MenuDemo {
18
18
selected = '' ;
19
19
items = [
20
20
{ text : 'Refresh' } ,
21
- { text : 'Settings' } ,
21
+ { text : 'Settings with a longer name so we can test text wrapping ' } ,
22
22
{ text : 'Help' , disabled : true } ,
23
23
{ text : 'Sign Out' }
24
24
] ;
25
25
26
26
iconItems = [
27
- { text : 'Redial' , icon : 'dialpad' } ,
27
+ { text : 'Redial with a longer name so we can test text wrapping ' , icon : 'dialpad' } ,
28
28
{ text : 'Check voicemail' , icon : 'voicemail' , disabled : true } ,
29
29
{ text : 'Disable alerts' , icon : 'notifications_off' }
30
30
] ;
Original file line number Diff line number Diff line change 11
11
display : flex ;
12
12
flex-direction : row ;
13
13
max-width : 100% ;
14
- box-sizing : border-box ;
15
14
align-items : center ;
16
15
-webkit-tap-highlight-color : transparent ;
17
16
Original file line number Diff line number Diff line change @@ -21,14 +21,22 @@ $mat-menu-icon-margin: 16px !default;
21
21
-webkit-overflow-scrolling : touch ; // for momentum scroll on mobile
22
22
}
23
23
24
- @mixin mat-menu-item-base () {
25
- @include mat-truncate-line ();
24
+ @mixin mat-menu-item-base (
25
+ $display : block ,
26
+ $truncate : true,
27
+ $height : $mat-menu-item-height ,
28
+ $line-height : $height ) {
29
+
30
+ @if $truncate {
31
+ @include mat-truncate-line ();
32
+ }
26
33
27
34
// Needs to be a block for the ellipsis to work.
28
- display : block ;
29
- line- height : $mat-menu-item- height ;
30
- height : $mat-menu-item -height ;
35
+ display : $display ;
36
+ height : $height ;
37
+ line- height : $line -height ;
31
38
padding : 0 $mat-menu-side-padding ;
39
+ box-sizing : border-box ;
32
40
33
41
text-align : left ;
34
42
text-decoration : none ; // necessary to reset anchor tags
Original file line number Diff line number Diff line change 6
6
$mat-menu-vertical-padding : 8px !default ;
7
7
$mat-menu-border-radius : 4px !default ;
8
8
$mat-menu-submenu-indicator-size : 10px !default ;
9
+ $mat-menu-item-vertical-padding : 8px !default ;
9
10
10
11
.mat-menu-panel {
11
12
@include mat-menu-base ();
@@ -41,9 +42,17 @@ $mat-menu-submenu-indicator-size: 10px !default;
41
42
42
43
.mat-menu-item {
43
44
@include mat-button-reset ();
44
- @include mat-menu-item-base ();
45
+ @include mat-menu-item-base (flex , false, auto , normal );
45
46
position : relative ;
46
47
48
+ // TODO(crisbeto): most of these can be moved into the `mat-menu-item-base`
49
+ // once we start allowing text wrapping in mat-select and mat-autocomplete.
50
+ align-items : center ;
51
+ white-space : normal ;
52
+ min-height : $mat-menu-item-height ;
53
+ padding-top : $mat-menu-item-vertical-padding ;
54
+ padding-bottom : $mat-menu-item-vertical-padding ;
55
+
47
56
& [disabled ] {
48
57
// Usually every click inside the menu closes it, however some browsers will stop events
49
58
// when the user clicks on a disabled item, **except** when the user clicks on a non-disabled
You can’t perform that action at this time.
0 commit comments