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" (#14505)
* Revert "Revert "fix(snack-bar): announcing same message twice to screen readers" (#14494)" This reverts commite9466a4ab7. * Revert "Revert "fix(dialog,bottom-sheet): invert backdrop color on dark themes" (#14492)" This reverts commit3eb7e9c480. * Revert "Revert "fix(menu): allow text wrapping in menu items" (#14493)" This reverts commita3da8d2b5b. * Revert "build: update nodejs bazel rules (#14466)" This reverts commita3fef46a8e. * Revert "docs(form-field): native select reset values not working in examples (#14236)" This reverts commit97f52c0924. * Revert "fix(menu): allow text wrapping in menu items (#11430)" This reverts commit3661abe061. * Revert "fix(dialog,bottom-sheet): invert backdrop color on dark themes (#13065)" This reverts commitfe96f38c10. * Revert "build: replace deprecated tslint rule with compiler option (#13186)" This reverts commit5dfa45ffa4. * Revert "fix(snack-bar): announcing same message twice to screen readers (#13298)" This reverts commit3fb4b2372f. * Revert "feat(drag-drop): allow entire group of drop lists to be disabled (#14179)" This reverts commit94e76de1e1. * Revert "fix(drag-drop): prevent text selection while dragging on Safari (#14405)" This reverts commit220e3885f2. * Revert "fix(autocomplete): auto-highlighted first option not display correctly if the floating label is disabled (#14414)" This reverts commit53d2b58311.
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