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
1 change: 0 additions & 1 deletion src/lib/autocomplete/autocomplete-trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,6 @@ export class MatAutocompleteTrigger implements ControlValueAccessor, OnDestroy {
switchMap(() => {
this._resetActiveItem();
this.autocomplete._setVisibility();
this._changeDetectorRef.detectChanges();

if (this.panelOpen) {
this._overlayRef!.updatePosition();
Expand Down
16 changes: 0 additions & 16 deletions src/lib/autocomplete/autocomplete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1644,22 +1644,6 @@ describe('MatAutocomplete', () => {
.toContain('mat-active', 'Expected first option to be highlighted.');
}));

it('should be able to preselect the first option when the floating label is disabled',
fakeAsync(() => {
fixture.componentInstance.floatLabel = 'never';
fixture.componentInstance.trigger.autocomplete.autoActiveFirstOption = true;
fixture.detectChanges();

fixture.componentInstance.trigger.openPanel();
fixture.detectChanges();
zone.simulateZoneExit();
// Note: should not have a detectChanges call here
// in order for the test to fail when it's supposed to.

expect(overlayContainerElement.querySelectorAll('mat-option')[0].classList)
.toContain('mat-active', 'Expected first option to be highlighted.');
}));

it('should be able to configure preselecting the first option globally', fakeAsync(() => {
overlayContainer.ngOnDestroy();
fixture.destroy();
Expand Down