diff --git a/src/lib/select/select-animations.ts b/src/lib/select/select-animations.ts index e9b1d33c487..ce3e24c67b8 100644 --- a/src/lib/select/select-animations.ts +++ b/src/lib/select/select-animations.ts @@ -58,10 +58,10 @@ export const transformPanel: AnimationEntryMetadata = trigger('transformPanel', width: '100%', transform: `translate3d(0, 0, 0) scaleY(0)` }), - animate(`150ms cubic-bezier(0.55, 0, 0.55, 0.2)`) + animate(`150ms cubic-bezier(0.25, 0.8, 0.25, 1)`) ]), transition('* => void', [ - animate('250ms linear', style({opacity: 0})) + animate('250ms 100ms linear', style({opacity: 0})) ]) ]); diff --git a/src/lib/select/select.ts b/src/lib/select/select.ts index b081e82ed7b..b00d76d6249 100644 --- a/src/lib/select/select.ts +++ b/src/lib/select/select.ts @@ -105,9 +105,10 @@ export class MdSelect implements AfterContentInit, OnDestroy { this._panelOpen = true; } - /** Closes the overlay panel. */ + /** Closes the overlay panel and focuses the host element. */ close(): void { this._panelOpen = false; + this._focusHost(); } /** Whether or not the overlay panel is open. */ @@ -152,13 +153,15 @@ export class MdSelect implements AfterContentInit, OnDestroy { } } - /** Emits an event and sets focus when overlay panel is finished animating. */ + /** + * When the panel is finished animating, emits an event and focuses + * an option if the panel is open. + */ _onPanelDone(): void { if (this.panelOpen) { this._focusCorrectOption(); this.onOpen.emit(); } else { - this._focusHost(); this.onClose.emit(); } }