File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 167
167
</ mat-menu >
168
168
</ div >
169
169
</ div >
170
+
171
+ < div style ="height: 500px "> This div is for testing scrolled menus.</ div >
Original file line number Diff line number Diff line change 8
8
}
9
9
10
10
.end-icon {
11
- align-items : flex-end ;
11
+ justify-content : flex-end ;
12
12
}
13
13
}
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ import {
29
29
Inject ,
30
30
InjectionToken ,
31
31
Input ,
32
+ NgZone ,
32
33
OnDestroy ,
33
34
Optional ,
34
35
Output ,
@@ -127,6 +128,7 @@ export class MatMenuTrigger implements AfterContentInit, OnDestroy {
127
128
constructor ( private _overlay : Overlay ,
128
129
private _element : ElementRef ,
129
130
private _viewContainerRef : ViewContainerRef ,
131
+ private _ngZone : NgZone ,
130
132
@Inject ( MAT_MENU_SCROLL_STRATEGY ) private _scrollStrategy ,
131
133
@Optional ( ) private _parentMenu : MatMenu ,
132
134
@Optional ( ) @Self ( ) private _menuItemInstance : MatMenuItem ,
@@ -341,7 +343,8 @@ export class MatMenuTrigger implements AfterContentInit, OnDestroy {
341
343
const posX : MenuPositionX = change . connectionPair . overlayX === 'start' ? 'after' : 'before' ;
342
344
const posY : MenuPositionY = change . connectionPair . overlayY === 'top' ? 'below' : 'above' ;
343
345
344
- this . menu . setPositionClasses ( posX , posY ) ;
346
+ // Note that the position changes may be outside the Angular zone
347
+ this . _ngZone . run ( ( ) => this . menu . setPositionClasses ( posX , posY ) ) ;
345
348
} ) ;
346
349
}
347
350
You can’t perform that action at this time.
0 commit comments