Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/lib/autocomplete/autocomplete-trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ export class MdAutocompleteTrigger implements ControlValueAccessor, OnDestroy {
this._subscribeToClosingActions();
}

this._panelOpen = true;
this.autocomplete._setVisibility();
this._floatPlaceholder();
this._panelOpen = true;
}

/** Closes the autocomplete suggestion panel. */
Expand Down
15 changes: 15 additions & 0 deletions src/lib/autocomplete/autocomplete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,21 @@ describe('MdAutocomplete', () => {
});
}));

it('should show the panel when the first open is after the initial zone stabilization',
async(() => {
// Note that we're running outside the Angular zone, in order to be able
// to test properly without the subscription from `_subscribeToClosingActions`
// giving us a false positive.
fixture.ngZone.runOutsideAngular(() => {
fixture.componentInstance.trigger.openPanel();

Promise.resolve().then(() => {
expect(fixture.componentInstance.panel.showPanel)
.toBe(true, `Expected panel to be visible.`);
});
});
}));

it('should close the panel when blurred', async(() => {
dispatchFakeEvent(input, 'focus');
fixture.detectChanges();
Expand Down