@@ -26,7 +26,7 @@ import {
26
26
MatMenuItem ,
27
27
} from './index' ;
28
28
import { MENU_PANEL_TOP_PADDING } from './menu-trigger' ;
29
- import { extendObject , MatRipple } from '@angular/material/core' ;
29
+ import { MatRipple } from '@angular/material/core' ;
30
30
import {
31
31
dispatchKeyboardEvent ,
32
32
dispatchMouseEvent ,
@@ -438,11 +438,11 @@ describe('MatMenu', () => {
438
438
*/
439
439
class OverlapSubject < T extends TestableMenu > {
440
440
readonly fixture : ComponentFixture < T > ;
441
- readonly trigger : any ;
441
+ readonly trigger : HTMLElement ;
442
442
443
443
constructor ( ctor : { new ( ) : T ; } , inputs : { [ key : string ] : any } = { } ) {
444
444
this . fixture = TestBed . createComponent ( ctor ) ;
445
- extendObject ( this . fixture . componentInstance , inputs ) ;
445
+ Object . keys ( inputs ) . forEach ( key => this . fixture . componentInstance [ key ] = inputs [ key ] ) ;
446
446
this . fixture . detectChanges ( ) ;
447
447
this . trigger = this . fixture . componentInstance . triggerEl . nativeElement ;
448
448
}
@@ -452,11 +452,6 @@ describe('MatMenu', () => {
452
452
this . fixture . detectChanges ( ) ;
453
453
}
454
454
455
- updateTriggerStyle ( style : any ) {
456
- return extendObject ( this . trigger . style , style ) ;
457
- }
458
-
459
-
460
455
get overlayRect ( ) {
461
456
return this . overlayPane . getBoundingClientRect ( ) ;
462
457
}
@@ -507,7 +502,8 @@ describe('MatMenu', () => {
507
502
it ( 'supports above position fall back' , ( ) => {
508
503
// Push trigger to the bottom part of viewport, so it doesn't have space to open
509
504
// in its default "below" position below the trigger.
510
- subject . updateTriggerStyle ( { position : 'fixed' , bottom : '0' } ) ;
505
+ subject . trigger . style . position = 'fixed' ;
506
+ subject . trigger . style . bottom = '0' ;
511
507
subject . openMenu ( ) ;
512
508
513
509
// Since the menu is above the trigger, the overlay bottom should be the trigger top.
0 commit comments