Skip to content

Commit cac1d4f

Browse files
committed
fix(menu): getBackdropElement
references #7125
1 parent 01c7c1a commit cac1d4f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/components/backdrop/backdrop.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Directive, Input } from '@angular/core';
1+
import { Directive, ElementRef, Input } from '@angular/core';
22

33
import { AppRoot } from '../app/app';
44
import { isTrueProperty } from '../../util/util';
@@ -39,7 +39,7 @@ export class Backdrop {
3939
private pushed: boolean = false;
4040
@Input() disableScroll = true;
4141

42-
constructor(private _appRoot: AppRoot) {}
42+
constructor(private _appRoot: AppRoot, private _elementRef: ElementRef) {}
4343

4444
ngOnInit() {
4545
if (isTrueProperty(this.disableScroll)) {
@@ -55,4 +55,8 @@ export class Backdrop {
5555
}
5656
}
5757

58+
getNativeElement(): HTMLElement {
59+
return this._elementRef.nativeElement;
60+
}
61+
5862
}

src/components/menu/menu.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ export class Menu extends Ion {
614614
* @private
615615
*/
616616
getBackdropElement(): HTMLElement {
617-
return this.backdrop.elementRef.nativeElement;
617+
return this.backdrop.getNativeElement();
618618
}
619619

620620
/**

0 commit comments

Comments
 (0)