Fix toast directive: corrected detection of snack bar container.

This commit is contained in:
Igor Kulikov 2021-06-07 13:31:49 +03:00
parent 31ebf4e645
commit 84d85e5519

View File

@ -312,7 +312,7 @@ export class TbSnackBarComponent implements AfterViewInit, OnDestroy {
ngAfterViewInit() {
if (this.snackBarRef) {
this.parentEl = this.data.parent.nativeElement;
this.snackBarContainerEl = this.elementRef.nativeElement.parentNode;
this.snackBarContainerEl = $(this.elementRef.nativeElement).closest('snack-bar-container')[0];
this.snackBarContainerEl.style.position = 'absolute';
this.updateContainerRect();
this.updatePosition(this.snackBarRef.containerInstance.snackBarConfig);