Skip to content

Commit 8b6efb1

Browse files
crisbetojelbourn
authored andcommitted
fix(datepicker): pass layout direction to touchUi dialog (#5052)
Passes the datepicker trigger's direction to the dialog in `touchUi` mode. This was already being done for the datepicker in popup mode.
1 parent 3d8c833 commit 8b6efb1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib/datepicker/datepicker.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,10 @@ export class MdDatepicker<D> implements OnDestroy {
245245

246246
/** Open the calendar as a dialog. */
247247
private _openAsDialog(): void {
248-
let config = new MdDialogConfig();
249-
config.viewContainerRef = this._viewContainerRef;
250-
251-
this._dialogRef = this._dialog.open(MdDatepickerContent, config);
248+
this._dialogRef = this._dialog.open(MdDatepickerContent, {
249+
viewContainerRef: this._viewContainerRef,
250+
direction: this._dir ? this._dir.value : 'ltr'
251+
});
252252
this._dialogRef.afterClosed().subscribe(() => this.close());
253253
this._dialogRef.componentInstance.datepicker = this;
254254
}

0 commit comments

Comments
 (0)