File tree 2 files changed +21
-2
lines changed
2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,18 @@ export class MatMenuTrigger implements AfterContentInit, OnDestroy {
187
187
188
188
this . _menuItemInstance ?. _setTriggersSubmenu ( this . triggersSubmenu ( ) ) ;
189
189
}
190
+ private _pressedWhileOpen : boolean = false ;
191
+ @Input ( )
192
+ set pressedWhileOpen ( value : boolean ) {
193
+ this . _pressedWhileOpen = value ;
194
+ if ( value ) {
195
+ this . _element . nativeElement . classList . add ( 'stay-open-while-press' ) ;
196
+ }
197
+ }
198
+ get pressedWhileOpen ( ) : boolean {
199
+ return this . _pressedWhileOpen ;
200
+ }
201
+
190
202
private _menu : MatMenuPanel | null ;
191
203
192
204
/** Data to be passed along to any lazily-rendered content. */
Original file line number Diff line number Diff line change @@ -13,11 +13,16 @@ mat-menu {
13
13
display : none ;
14
14
}
15
15
16
+ .mat-mdc-menu-trigger.stay-open-while-press [aria-expanded = ' true' ] {
17
+ .mat-mdc-button-persistent-ripple :before {
18
+ opacity : var (--mat-icon-button-pressed-state-layer-opacity );
19
+ }
20
+ }
21
+
16
22
.mat-mdc-menu-content {
17
23
margin : 0 ;
18
24
padding : 8px 0 ;
19
25
outline : 0 ;
20
-
21
26
& ,
22
27
.mat-mdc-menu-item .mat-mdc-menu-item-text {
23
28
@include vendor-prefixes .smooth-font ();
@@ -165,7 +170,9 @@ mat-menu {
165
170
// The class selector isn't specific enough to overide the link pseudo selectors so we need
166
171
// to target them specifically, otherwise the item color might be overwritten by the user
167
172
// agent resets of the app.
168
- & , & :visited , & :link {
173
+ & ,
174
+ & :visited ,
175
+ & :link {
169
176
color : token-utils .slot (item-label-text-color );
170
177
}
171
178
You can’t perform that action at this time.
0 commit comments