Skip to content

Commit

Permalink
fix(dialog): update position of dialog when there are changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Enlcxx committed Apr 29, 2019
1 parent 5b63bdc commit e191600
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/dialog/dialog-container.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
Renderer2,
ElementRef,
ChangeDetectorRef,
DoCheck,
} from '@angular/core';
import { state, style, transition, animate, trigger, AnimationEvent } from '@angular/animations';
import { LyOverlayRef, LyTheme2, ThemeVariables, shadowBuilder } from '@alyle/ui';
Expand Down Expand Up @@ -63,7 +64,7 @@ const STYLES = (theme: ThemeVariables) => ({
'(@dialogContainer.done)': '_onAnimationDone($event)'
}
})
export class LyDialogContainer implements OnInit {
export class LyDialogContainer implements OnInit, DoCheck {
/** @docs-private */
readonly classes = this._theme.addStyleSheet(STYLES, STYLE_PRIORITY);
private _embeddedViewRef: EmbeddedViewRef<any>;
Expand Down Expand Up @@ -120,6 +121,10 @@ export class LyDialogContainer implements OnInit {
}
}

ngDoCheck() {
this._overlayRef.onResizeScroll!();
}

/** @internal */
_init(componentFactoryOrTemplate: ComponentFactory<any> | TemplateRef<any>, newInjector: Injector) {
this._componentFactoryOrTemplate = componentFactoryOrTemplate;
Expand Down

0 comments on commit e191600

Please sign in to comment.