mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
Revert "fix(autocomplete): auto-highlighted first option not display correctly if the floating label is disabled" (#14396)
* Revert "fix(drag-drop): error on touch end (#14392)" This reverts commit53cecbb5f9. * Revert "fix(menu): reduce specificity of icon selector (#14389)" This reverts commit74e945adc9. * Revert "fix(drag-drop): throw better error when attaching to non-element node (#14221)" This reverts commit31f0e6d5ad. * Revert "fix(autocomplete): auto-highlighted first option not display correctly if the floating label is disabled (#13774)" This reverts commitc99c512106.
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user