From 4d42a90476281807c83a530086d3d34ed1b72197 Mon Sep 17 00:00:00 2001 From: vivian-hu <41269630+vivian-hu@users.noreply.github.com> Date: Thu, 13 Dec 2018 11:37:06 -0800 Subject: [PATCH] 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 commit e9466a4ab7663d68d176eae4335c769ac2749052. * Revert "Revert "fix(dialog,bottom-sheet): invert backdrop color on dark themes" (#14492)" This reverts commit 3eb7e9c480a622f38a90a2550c97273ecbdbe17f. * Revert "Revert "fix(menu): allow text wrapping in menu items" (#14493)" This reverts commit a3da8d2b5bd3c3a92c39ff34d98f1acaf95a56b0. * Revert "build: update nodejs bazel rules (#14466)" This reverts commit a3fef46a8eade83ca763c6a83842581a201d8cf7. * Revert "docs(form-field): native select reset values not working in examples (#14236)" This reverts commit 97f52c092426cf6f097f08426b064d4d0b61a957. * Revert "fix(menu): allow text wrapping in menu items (#11430)" This reverts commit 3661abe06109d1f675ae4089b09169f9170f65dd. * Revert "fix(dialog,bottom-sheet): invert backdrop color on dark themes (#13065)" This reverts commit fe96f38c103acb1d5b05ebec373bcaee9560f02d. * Revert "build: replace deprecated tslint rule with compiler option (#13186)" This reverts commit 5dfa45ffa468cabbad47fdfc04a3e0f36f1efbc9. * Revert "fix(snack-bar): announcing same message twice to screen readers (#13298)" This reverts commit 3fb4b2372f419f0728e6a889e930bd3868673880. * Revert "feat(drag-drop): allow entire group of drop lists to be disabled (#14179)" This reverts commit 94e76de1e1c7e7976a79fd8e744af5433e8f5eb9. * Revert "fix(drag-drop): prevent text selection while dragging on Safari (#14405)" This reverts commit 220e3885f254740c3036f87ded4b5e5f9f07ea40. * Revert "fix(autocomplete): auto-highlighted first option not display correctly if the floating label is disabled (#14414)" This reverts commit 53d2b583111b5f17216ffefe800c55e2e25373fa. --- src/lib/autocomplete/autocomplete-trigger.ts | 1 - src/lib/autocomplete/autocomplete.spec.ts | 16 ---------------- 2 files changed, 17 deletions(-) diff --git a/src/lib/autocomplete/autocomplete-trigger.ts b/src/lib/autocomplete/autocomplete-trigger.ts index f0d1aae55a8..ea86763a572 100644 --- a/src/lib/autocomplete/autocomplete-trigger.ts +++ b/src/lib/autocomplete/autocomplete-trigger.ts @@ -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(); diff --git a/src/lib/autocomplete/autocomplete.spec.ts b/src/lib/autocomplete/autocomplete.spec.ts index 42038e56fe7..143ea70c8f0 100644 --- a/src/lib/autocomplete/autocomplete.spec.ts +++ b/src/lib/autocomplete/autocomplete.spec.ts @@ -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();