Skip to content

Commit

Permalink
fix(select): fix select panel animation (#2699)
Browse files Browse the repository at this point in the history
Fixes #2695
  • Loading branch information
kara authored and mmalerba committed Jan 18, 2017
1 parent e055d05 commit 15eb33a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/select/select.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="md-select-panel" [@transformPanel]="'showing'" (@transformPanel.done)="_onPanelDone()"
(keydown)="_keyManager.onKeydown($event)" [style.transformOrigin]="_transformOrigin"
[class.md-select-panel-done-animating]="_panelDoneAnimating">
<div class="md-select-content" [@fadeInContent]="'showing'">
<div class="md-select-content" [@fadeInContent]="'showing'" (@fadeInContent.done)="_onFadeInDone()">
<ng-content></ng-content>
</div>
</div>
Expand Down
10 changes: 8 additions & 2 deletions src/lib/select/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@ export class MdSelect implements AfterContentInit, ControlValueAccessor, OnDestr
}

/**
* When the panel is finished animating, emits an event and focuses
* an option if the panel is open.
* When the panel element is finished transforming in (though not fading in), it
* emits an event and focuses an option if the panel is open.
*/
_onPanelDone(): void {
if (this.panelOpen) {
Expand All @@ -372,7 +372,13 @@ export class MdSelect implements AfterContentInit, ControlValueAccessor, OnDestr
} else {
this.onClose.emit();
}
}

/**
* When the panel content is done fading in, the _panelDoneAnimating property is
* set so the proper class can be added to the panel.
*/
_onFadeInDone(): void {
this._panelDoneAnimating = this.panelOpen;
}

Expand Down

0 comments on commit 15eb33a

Please sign in to comment.