Skip to content

Commit 15eb33a

Browse files
karammalerba
authored andcommitted
fix(select): fix select panel animation (#2699)
Fixes #2695
1 parent e055d05 commit 15eb33a

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/lib/select/select.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<div class="md-select-panel" [@transformPanel]="'showing'" (@transformPanel.done)="_onPanelDone()"
1212
(keydown)="_keyManager.onKeydown($event)" [style.transformOrigin]="_transformOrigin"
1313
[class.md-select-panel-done-animating]="_panelDoneAnimating">
14-
<div class="md-select-content" [@fadeInContent]="'showing'">
14+
<div class="md-select-content" [@fadeInContent]="'showing'" (@fadeInContent.done)="_onFadeInDone()">
1515
<ng-content></ng-content>
1616
</div>
1717
</div>

src/lib/select/select.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,8 @@ export class MdSelect implements AfterContentInit, ControlValueAccessor, OnDestr
362362
}
363363

364364
/**
365-
* When the panel is finished animating, emits an event and focuses
366-
* an option if the panel is open.
365+
* When the panel element is finished transforming in (though not fading in), it
366+
* emits an event and focuses an option if the panel is open.
367367
*/
368368
_onPanelDone(): void {
369369
if (this.panelOpen) {
@@ -372,7 +372,13 @@ export class MdSelect implements AfterContentInit, ControlValueAccessor, OnDestr
372372
} else {
373373
this.onClose.emit();
374374
}
375+
}
375376

377+
/**
378+
* When the panel content is done fading in, the _panelDoneAnimating property is
379+
* set so the proper class can be added to the panel.
380+
*/
381+
_onFadeInDone(): void {
376382
this._panelDoneAnimating = this.panelOpen;
377383
}
378384

0 commit comments

Comments
 (0)