Skip to content

Commit

Permalink
fix(datepicker): fix bug where calendar dialog could only be opened o…
Browse files Browse the repository at this point in the history
…nce (#3685)

* fix(datepicker): fix bug where calendar dialog could only be opened once

* add rxjs first operator
  • Loading branch information
mmalerba committed Apr 14, 2017
1 parent 3636774 commit 0bc2a26
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/datepicker/datepicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
import {SimpleDate} from '../core/datetime/simple-date';
import {MdDatepickerInput} from './datepicker-input';
import {CalendarLocale} from '../core/datetime/calendar-locale';
import 'rxjs/add/operator/first';


/** Used to generate a unique ID for each datepicker instance. */
Expand Down Expand Up @@ -178,6 +179,7 @@ export class MdDatepicker implements OnDestroy {
/** Open the calendar as a dialog. */
private _openAsDialog(): void {
this._dialogRef = this._dialog.open(this.calendarTemplate);
this._dialogRef.afterClosed().first().subscribe(() => this.close());
}

/** Open the calendar as a popup. */
Expand Down

0 comments on commit 0bc2a26

Please sign in to comment.