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 @@ -19,13 +19,13 @@ export class MenuDemo {
19
19
selected = '' ;
20
20
items = [
21
21
{ text : 'Refresh' } ,
22
- { text : 'Settings' } ,
22
+ { text : 'Settings with a longer name so we can test text wrapping ' } ,
23
23
{ text : 'Help' , disabled : true } ,
24
24
{ text : 'Sign Out' }
25
25
] ;
26
26
27
27
iconItems = [
28
- { text : 'Redial' , icon : 'dialpad' } ,
28
+ { text : 'Redial with a longer name so we can test text wrapping ' , icon : 'dialpad' } ,
29
29
{ text : 'Check voicemail' , icon : 'voicemail' , disabled : true } ,
30
30
{ text : 'Disable alerts' , icon : 'notifications_off' }
31
31
] ;
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 @@ -20,14 +20,22 @@ $mat-menu-icon-margin: 16px !default;
20
20
-webkit-overflow-scrolling : touch ; // for momentum scroll on mobile
21
21
}
22
22
23
- @mixin mat-menu-item-base () {
24
- @include mat-truncate-line ();
23
+ @mixin mat-menu-item-base (
24
+ $display : block ,
25
+ $truncate : true,
26
+ $height : $mat-menu-item-height ,
27
+ $line-height : $height ) {
28
+
29
+ @if $truncate {
30
+ @include mat-truncate-line ();
31
+ }
25
32
26
33
// Needs to be a block for the ellipsis to work.
27
- display : block ;
28
- line- height : $mat-menu-item- height ;
29
- height : $mat-menu-item -height ;
34
+ display : $display ;
35
+ height : $height ;
36
+ line- height : $line -height ;
30
37
padding : 0 $mat-menu-side-padding ;
38
+ box-sizing : border-box ;
31
39
32
40
text-align : left ;
33
41
text-decoration : none ; // necessary to reset anchor tags
Original file line number Diff line number Diff line change 5
5
@import ' ../../cdk/a11y/a11y' ;
6
6
7
7
$mat-menu-vertical-padding : 8px !default ;
8
+ $mat-menu-item-vertical-padding : 8px !default ;
8
9
$mat-menu-border-radius : 4px !default ;
9
10
$mat-menu-submenu-indicator-size : 10px !default ;
10
11
@@ -27,9 +28,17 @@ $mat-menu-submenu-indicator-size: 10px !default;
27
28
28
29
.mat-menu-item {
29
30
@include mat-button-reset ();
30
- @include mat-menu-item-base ();
31
+ @include mat-menu-item-base (flex , false, auto , normal );
31
32
position : relative ;
32
33
34
+ // TODO(crisbeto): most of these can be moved into the `mat-menu-item-base`
35
+ // once we start allowing text wrapping in mat-select and mat-autocomplete.
36
+ align-items : center ;
37
+ white-space : normal ;
38
+ min-height : $mat-menu-item-height ;
39
+ padding-top : $mat-menu-item-vertical-padding ;
40
+ padding-bottom : $mat-menu-item-vertical-padding ;
41
+
33
42
@include cdk-high-contrast {
34
43
& .cdk-program-focused ,
35
44
& .cdk-keyboard-focused ,
You can’t perform that action at this time.
0 commit comments