From fe58a16d49da46da2ca05df6b696ad8345c4f566 Mon Sep 17 00:00:00 2001 From: vivian-hu <41269630+vivian-hu@users.noreply.github.com> Date: Thu, 13 Dec 2018 10:57:50 -0800 Subject: [PATCH 01/12] Revert "Revert "fix(snack-bar): announcing same message twice to screen readers" (#14494)" This reverts commit e9466a4ab7663d68d176eae4335c769ac2749052. --- src/lib/snack-bar/snack-bar.spec.ts | 8 +++----- src/lib/snack-bar/snack-bar.ts | 6 ++++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/snack-bar/snack-bar.spec.ts b/src/lib/snack-bar/snack-bar.spec.ts index 2a65a919a07e..21fc199a7bb5 100644 --- a/src/lib/snack-bar/snack-bar.spec.ts +++ b/src/lib/snack-bar/snack-bar.spec.ts @@ -186,18 +186,16 @@ describe('MatSnackBar', () => { })); - it('should default to the passed message for the announcement message', fakeAsync(() => { + it('should clear the announcement message if it is the same as main message', fakeAsync(() => { spyOn(liveAnnouncer, 'announce'); - snackBar.open(simpleMessage); + snackBar.open(simpleMessage, undefined, {announcementMessage: simpleMessage}); viewContainerFixture.detectChanges(); expect(overlayContainerElement.childElementCount) .toBe(1, 'Expected the overlay with the default announcement message to be added'); - // Expect the live announcer to have been called with the display message and some - // string for the politeness. We do not want to test for the default politeness here. - expect(liveAnnouncer.announce).toHaveBeenCalledWith(simpleMessage, jasmine.any(String)); + expect(liveAnnouncer.announce).not.toHaveBeenCalled(); })); it('should be able to specify a custom announcement message', fakeAsync(() => { diff --git a/src/lib/snack-bar/snack-bar.ts b/src/lib/snack-bar/snack-bar.ts index d2028d0dd1bb..84d1293f66b7 100644 --- a/src/lib/snack-bar/snack-bar.ts +++ b/src/lib/snack-bar/snack-bar.ts @@ -114,8 +114,10 @@ export class MatSnackBar implements OnDestroy { // override the data to pass in our own message and action. _config.data = {message, action}; - if (!_config.announcementMessage) { - _config.announcementMessage = message; + // Since the snack bar has `role="alert"`, we don't + // want to announce the same message twice. + if (_config.announcementMessage === message) { + _config.announcementMessage = undefined; } return this.openFromComponent(SimpleSnackBar, _config); From 94f1f26234253b95ca9d80b404cd570934f93f3d Mon Sep 17 00:00:00 2001 From: vivian-hu <41269630+vivian-hu@users.noreply.github.com> Date: Thu, 13 Dec 2018 10:57:50 -0800 Subject: [PATCH 02/12] Revert "Revert "fix(dialog,bottom-sheet): invert backdrop color on dark themes" (#14492)" This reverts commit 3eb7e9c480a622f38a90a2550c97273ecbdbe17f. --- src/dev-app/dialog/dialog-demo.ts | 2 +- src/lib/bottom-sheet/_bottom-sheet-theme.scss | 5 +++++ src/lib/bottom-sheet/bottom-sheet-config.ts | 2 +- src/lib/dialog/_dialog-theme.scss | 5 +++++ src/lib/dialog/dialog-config.ts | 2 +- src/lib/dialog/dialog.ts | 6 +++--- 6 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/dev-app/dialog/dialog-demo.ts b/src/dev-app/dialog/dialog-demo.ts index b3640fa356be..b8149315e00f 100644 --- a/src/dev-app/dialog/dialog-demo.ts +++ b/src/dev-app/dialog/dialog-demo.ts @@ -28,7 +28,7 @@ export class DialogDemo { disableClose: false, panelClass: 'custom-overlay-pane-class', hasBackdrop: true, - backdropClass: '', + backdropClass: defaultDialogConfig.backdropClass, width: '', height: '', minWidth: '', diff --git a/src/lib/bottom-sheet/_bottom-sheet-theme.scss b/src/lib/bottom-sheet/_bottom-sheet-theme.scss index 046e11d0b5f7..3c3139029c2e 100644 --- a/src/lib/bottom-sheet/_bottom-sheet-theme.scss +++ b/src/lib/bottom-sheet/_bottom-sheet-theme.scss @@ -5,12 +5,17 @@ @mixin mat-bottom-sheet-theme($theme) { $background: map-get($theme, background); $foreground: map-get($theme, foreground); + $backdrop-color: invert(mat-color($background, card, 0.288)); .mat-bottom-sheet-container { @include _mat-theme-elevation(16, $theme); background: mat-color($background, dialog); color: mat-color($foreground, text); } + + .mat-bottom-sheet-backdrop { + background: $backdrop-color; + } } @mixin mat-bottom-sheet-typography($config) { diff --git a/src/lib/bottom-sheet/bottom-sheet-config.ts b/src/lib/bottom-sheet/bottom-sheet-config.ts index 415d8f5aa9f5..ad32d75aff9b 100644 --- a/src/lib/bottom-sheet/bottom-sheet-config.ts +++ b/src/lib/bottom-sheet/bottom-sheet-config.ts @@ -32,7 +32,7 @@ export class MatBottomSheetConfig { hasBackdrop?: boolean = true; /** Custom class for the backdrop. */ - backdropClass?: string; + backdropClass?: string = 'mat-bottom-sheet-backdrop'; /** Whether the user can use escape or clicking outside to close the bottom sheet. */ disableClose?: boolean = false; diff --git a/src/lib/dialog/_dialog-theme.scss b/src/lib/dialog/_dialog-theme.scss index c073788a4c48..afda210c3d6a 100644 --- a/src/lib/dialog/_dialog-theme.scss +++ b/src/lib/dialog/_dialog-theme.scss @@ -7,12 +7,17 @@ @mixin mat-dialog-theme($theme) { $background: map-get($theme, background); $foreground: map-get($theme, foreground); + $backdrop-color: invert(mat-color($background, card, 0.288)); .mat-dialog-container { @include _mat-theme-elevation(24, $theme); background: mat-color($background, dialog); color: mat-color($foreground, text); } + + .mat-dialog-backdrop { + background: $backdrop-color; + } } @mixin mat-dialog-typography($config) { diff --git a/src/lib/dialog/dialog-config.ts b/src/lib/dialog/dialog-config.ts index add3efbe9063..b098f2ecaff0 100644 --- a/src/lib/dialog/dialog-config.ts +++ b/src/lib/dialog/dialog-config.ts @@ -54,7 +54,7 @@ export class MatDialogConfig { hasBackdrop?: boolean = true; /** Custom class for the backdrop, */ - backdropClass?: string = ''; + backdropClass?: string = 'mat-dialog-backdrop'; /** Whether the user can use escape or clicking on the backdrop to close the modal. */ disableClose?: boolean = false; diff --git a/src/lib/dialog/dialog.ts b/src/lib/dialog/dialog.ts index e1be22a997ef..65d1ba0797a5 100644 --- a/src/lib/dialog/dialog.ts +++ b/src/lib/dialog/dialog.ts @@ -189,7 +189,7 @@ export class MatDialog implements OnDestroy { * @returns The overlay configuration. */ private _getOverlayConfig(dialogConfig: MatDialogConfig): OverlayConfig { - const state = new OverlayConfig({ + const overlayConfig = new OverlayConfig({ positionStrategy: this._overlay.position().global(), scrollStrategy: dialogConfig.scrollStrategy || this._scrollStrategy(), panelClass: dialogConfig.panelClass, @@ -203,10 +203,10 @@ export class MatDialog implements OnDestroy { }); if (dialogConfig.backdropClass) { - state.backdropClass = dialogConfig.backdropClass; + overlayConfig.backdropClass = dialogConfig.backdropClass; } - return state; + return overlayConfig; } /** From 73d382c48113cc4f704038680185ecb609126a02 Mon Sep 17 00:00:00 2001 From: vivian-hu <41269630+vivian-hu@users.noreply.github.com> Date: Thu, 13 Dec 2018 10:57:50 -0800 Subject: [PATCH 03/12] Revert "Revert "fix(menu): allow text wrapping in menu items" (#14493)" This reverts commit a3da8d2b5bd3c3a92c39ff34d98f1acaf95a56b0. --- src/dev-app/menu/menu-demo.ts | 4 ++-- src/lib/core/option/option.scss | 1 - src/lib/core/style/_menu-common.scss | 1 + src/lib/menu/menu.scss | 12 ++++++++++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/dev-app/menu/menu-demo.ts b/src/dev-app/menu/menu-demo.ts index 20e3fee415a6..66db0c5efadb 100644 --- a/src/dev-app/menu/menu-demo.ts +++ b/src/dev-app/menu/menu-demo.ts @@ -19,13 +19,13 @@ export class MenuDemo { selected = ''; items = [ {text: 'Refresh'}, - {text: 'Settings'}, + {text: 'Settings with a longer name so we can test text wrapping'}, {text: 'Help', disabled: true}, {text: 'Sign Out'} ]; iconItems = [ - {text: 'Redial', icon: 'dialpad'}, + {text: 'Redial with a longer name so we can test text wrapping', icon: 'dialpad'}, {text: 'Check voicemail', icon: 'voicemail', disabled: true}, {text: 'Disable alerts', icon: 'notifications_off'} ]; diff --git a/src/lib/core/option/option.scss b/src/lib/core/option/option.scss index d1d03547dc37..003cab1a1fc5 100644 --- a/src/lib/core/option/option.scss +++ b/src/lib/core/option/option.scss @@ -11,7 +11,6 @@ display: flex; flex-direction: row; max-width: 100%; - box-sizing: border-box; align-items: center; -webkit-tap-highlight-color: transparent; diff --git a/src/lib/core/style/_menu-common.scss b/src/lib/core/style/_menu-common.scss index a7159051fbc0..80ea8faeb70b 100644 --- a/src/lib/core/style/_menu-common.scss +++ b/src/lib/core/style/_menu-common.scss @@ -28,6 +28,7 @@ $mat-menu-icon-margin: 16px !default; line-height: $mat-menu-item-height; height: $mat-menu-item-height; padding: 0 $mat-menu-side-padding; + box-sizing: border-box; text-align: left; text-decoration: none; // necessary to reset anchor tags diff --git a/src/lib/menu/menu.scss b/src/lib/menu/menu.scss index 162407665f75..9dd0d3d19404 100644 --- a/src/lib/menu/menu.scss +++ b/src/lib/menu/menu.scss @@ -5,6 +5,7 @@ @import '../../cdk/a11y/a11y'; $mat-menu-vertical-padding: 8px !default; +$mat-menu-item-vertical-padding: 8px !default; $mat-menu-border-radius: 4px !default; $mat-menu-submenu-indicator-size: 10px !default; @@ -30,6 +31,17 @@ $mat-menu-submenu-indicator-size: 10px !default; @include mat-menu-item-base(); position: relative; + // TODO(crisbeto): most of these can be moved into the `mat-menu-item-base` + // once we start allowing text wrapping in mat-select and mat-autocomplete. + display: flex; + align-items: center; + white-space: normal; + line-height: normal; + height: auto; + min-height: $mat-menu-item-height; + padding-top: $mat-menu-item-vertical-padding; + padding-bottom: $mat-menu-item-vertical-padding; + @include cdk-high-contrast { &.cdk-program-focused, &.cdk-keyboard-focused, From 3fec24a437047f0e72b840528423abc1bbc51168 Mon Sep 17 00:00:00 2001 From: vivian-hu <41269630+vivian-hu@users.noreply.github.com> Date: Thu, 13 Dec 2018 10:57:50 -0800 Subject: [PATCH 04/12] Revert "build: update nodejs bazel rules (#14466)" This reverts commit a3fef46a8eade83ca763c6a83842581a201d8cf7. From b4909eb135a479f40ac46d4b3423e564014bab51 Mon Sep 17 00:00:00 2001 From: vivian-hu <41269630+vivian-hu@users.noreply.github.com> Date: Thu, 13 Dec 2018 10:57:50 -0800 Subject: [PATCH 05/12] Revert "docs(form-field): native select reset values not working in examples (#14236)" This reverts commit 97f52c092426cf6f097f08426b064d4d0b61a957. From f625f216f47c49d752bdd3c0c59330f9119ddcb5 Mon Sep 17 00:00:00 2001 From: vivian-hu <41269630+vivian-hu@users.noreply.github.com> Date: Thu, 13 Dec 2018 10:57:50 -0800 Subject: [PATCH 06/12] Revert "fix(menu): allow text wrapping in menu items (#11430)" This reverts commit 3661abe06109d1f675ae4089b09169f9170f65dd. --- src/dev-app/menu/menu-demo.ts | 4 ++-- src/lib/core/option/option.scss | 1 + src/lib/core/style/_menu-common.scss | 1 - src/lib/menu/menu.scss | 12 ------------ 4 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/dev-app/menu/menu-demo.ts b/src/dev-app/menu/menu-demo.ts index 66db0c5efadb..20e3fee415a6 100644 --- a/src/dev-app/menu/menu-demo.ts +++ b/src/dev-app/menu/menu-demo.ts @@ -19,13 +19,13 @@ export class MenuDemo { selected = ''; items = [ {text: 'Refresh'}, - {text: 'Settings with a longer name so we can test text wrapping'}, + {text: 'Settings'}, {text: 'Help', disabled: true}, {text: 'Sign Out'} ]; iconItems = [ - {text: 'Redial with a longer name so we can test text wrapping', icon: 'dialpad'}, + {text: 'Redial', icon: 'dialpad'}, {text: 'Check voicemail', icon: 'voicemail', disabled: true}, {text: 'Disable alerts', icon: 'notifications_off'} ]; diff --git a/src/lib/core/option/option.scss b/src/lib/core/option/option.scss index 003cab1a1fc5..d1d03547dc37 100644 --- a/src/lib/core/option/option.scss +++ b/src/lib/core/option/option.scss @@ -11,6 +11,7 @@ display: flex; flex-direction: row; max-width: 100%; + box-sizing: border-box; align-items: center; -webkit-tap-highlight-color: transparent; diff --git a/src/lib/core/style/_menu-common.scss b/src/lib/core/style/_menu-common.scss index 80ea8faeb70b..a7159051fbc0 100644 --- a/src/lib/core/style/_menu-common.scss +++ b/src/lib/core/style/_menu-common.scss @@ -28,7 +28,6 @@ $mat-menu-icon-margin: 16px !default; line-height: $mat-menu-item-height; height: $mat-menu-item-height; padding: 0 $mat-menu-side-padding; - box-sizing: border-box; text-align: left; text-decoration: none; // necessary to reset anchor tags diff --git a/src/lib/menu/menu.scss b/src/lib/menu/menu.scss index 9dd0d3d19404..162407665f75 100644 --- a/src/lib/menu/menu.scss +++ b/src/lib/menu/menu.scss @@ -5,7 +5,6 @@ @import '../../cdk/a11y/a11y'; $mat-menu-vertical-padding: 8px !default; -$mat-menu-item-vertical-padding: 8px !default; $mat-menu-border-radius: 4px !default; $mat-menu-submenu-indicator-size: 10px !default; @@ -31,17 +30,6 @@ $mat-menu-submenu-indicator-size: 10px !default; @include mat-menu-item-base(); position: relative; - // TODO(crisbeto): most of these can be moved into the `mat-menu-item-base` - // once we start allowing text wrapping in mat-select and mat-autocomplete. - display: flex; - align-items: center; - white-space: normal; - line-height: normal; - height: auto; - min-height: $mat-menu-item-height; - padding-top: $mat-menu-item-vertical-padding; - padding-bottom: $mat-menu-item-vertical-padding; - @include cdk-high-contrast { &.cdk-program-focused, &.cdk-keyboard-focused, From 8c0d35e7be3fef3fa0001dfd690218efe045adb7 Mon Sep 17 00:00:00 2001 From: vivian-hu <41269630+vivian-hu@users.noreply.github.com> Date: Thu, 13 Dec 2018 10:57:50 -0800 Subject: [PATCH 07/12] Revert "fix(dialog,bottom-sheet): invert backdrop color on dark themes (#13065)" This reverts commit fe96f38c103acb1d5b05ebec373bcaee9560f02d. --- src/dev-app/dialog/dialog-demo.ts | 2 +- src/lib/bottom-sheet/_bottom-sheet-theme.scss | 5 ----- src/lib/bottom-sheet/bottom-sheet-config.ts | 2 +- src/lib/dialog/_dialog-theme.scss | 5 ----- src/lib/dialog/dialog-config.ts | 2 +- src/lib/dialog/dialog.ts | 6 +++--- 6 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/dev-app/dialog/dialog-demo.ts b/src/dev-app/dialog/dialog-demo.ts index b8149315e00f..b3640fa356be 100644 --- a/src/dev-app/dialog/dialog-demo.ts +++ b/src/dev-app/dialog/dialog-demo.ts @@ -28,7 +28,7 @@ export class DialogDemo { disableClose: false, panelClass: 'custom-overlay-pane-class', hasBackdrop: true, - backdropClass: defaultDialogConfig.backdropClass, + backdropClass: '', width: '', height: '', minWidth: '', diff --git a/src/lib/bottom-sheet/_bottom-sheet-theme.scss b/src/lib/bottom-sheet/_bottom-sheet-theme.scss index 3c3139029c2e..046e11d0b5f7 100644 --- a/src/lib/bottom-sheet/_bottom-sheet-theme.scss +++ b/src/lib/bottom-sheet/_bottom-sheet-theme.scss @@ -5,17 +5,12 @@ @mixin mat-bottom-sheet-theme($theme) { $background: map-get($theme, background); $foreground: map-get($theme, foreground); - $backdrop-color: invert(mat-color($background, card, 0.288)); .mat-bottom-sheet-container { @include _mat-theme-elevation(16, $theme); background: mat-color($background, dialog); color: mat-color($foreground, text); } - - .mat-bottom-sheet-backdrop { - background: $backdrop-color; - } } @mixin mat-bottom-sheet-typography($config) { diff --git a/src/lib/bottom-sheet/bottom-sheet-config.ts b/src/lib/bottom-sheet/bottom-sheet-config.ts index ad32d75aff9b..415d8f5aa9f5 100644 --- a/src/lib/bottom-sheet/bottom-sheet-config.ts +++ b/src/lib/bottom-sheet/bottom-sheet-config.ts @@ -32,7 +32,7 @@ export class MatBottomSheetConfig { hasBackdrop?: boolean = true; /** Custom class for the backdrop. */ - backdropClass?: string = 'mat-bottom-sheet-backdrop'; + backdropClass?: string; /** Whether the user can use escape or clicking outside to close the bottom sheet. */ disableClose?: boolean = false; diff --git a/src/lib/dialog/_dialog-theme.scss b/src/lib/dialog/_dialog-theme.scss index afda210c3d6a..c073788a4c48 100644 --- a/src/lib/dialog/_dialog-theme.scss +++ b/src/lib/dialog/_dialog-theme.scss @@ -7,17 +7,12 @@ @mixin mat-dialog-theme($theme) { $background: map-get($theme, background); $foreground: map-get($theme, foreground); - $backdrop-color: invert(mat-color($background, card, 0.288)); .mat-dialog-container { @include _mat-theme-elevation(24, $theme); background: mat-color($background, dialog); color: mat-color($foreground, text); } - - .mat-dialog-backdrop { - background: $backdrop-color; - } } @mixin mat-dialog-typography($config) { diff --git a/src/lib/dialog/dialog-config.ts b/src/lib/dialog/dialog-config.ts index b098f2ecaff0..add3efbe9063 100644 --- a/src/lib/dialog/dialog-config.ts +++ b/src/lib/dialog/dialog-config.ts @@ -54,7 +54,7 @@ export class MatDialogConfig { hasBackdrop?: boolean = true; /** Custom class for the backdrop, */ - backdropClass?: string = 'mat-dialog-backdrop'; + backdropClass?: string = ''; /** Whether the user can use escape or clicking on the backdrop to close the modal. */ disableClose?: boolean = false; diff --git a/src/lib/dialog/dialog.ts b/src/lib/dialog/dialog.ts index 65d1ba0797a5..e1be22a997ef 100644 --- a/src/lib/dialog/dialog.ts +++ b/src/lib/dialog/dialog.ts @@ -189,7 +189,7 @@ export class MatDialog implements OnDestroy { * @returns The overlay configuration. */ private _getOverlayConfig(dialogConfig: MatDialogConfig): OverlayConfig { - const overlayConfig = new OverlayConfig({ + const state = new OverlayConfig({ positionStrategy: this._overlay.position().global(), scrollStrategy: dialogConfig.scrollStrategy || this._scrollStrategy(), panelClass: dialogConfig.panelClass, @@ -203,10 +203,10 @@ export class MatDialog implements OnDestroy { }); if (dialogConfig.backdropClass) { - overlayConfig.backdropClass = dialogConfig.backdropClass; + state.backdropClass = dialogConfig.backdropClass; } - return overlayConfig; + return state; } /** From 80c299fb5fae950e98435b3a95d18983ccccea63 Mon Sep 17 00:00:00 2001 From: vivian-hu <41269630+vivian-hu@users.noreply.github.com> Date: Thu, 13 Dec 2018 10:57:50 -0800 Subject: [PATCH 08/12] Revert "build: replace deprecated tslint rule with compiler option (#13186)" This reverts commit 5dfa45ffa468cabbad47fdfc04a3e0f36f1efbc9. From c9b30afb4692d5d06d2a2e10fa1df3971b8a2305 Mon Sep 17 00:00:00 2001 From: vivian-hu <41269630+vivian-hu@users.noreply.github.com> Date: Thu, 13 Dec 2018 10:57:50 -0800 Subject: [PATCH 09/12] Revert "fix(snack-bar): announcing same message twice to screen readers (#13298)" This reverts commit 3fb4b2372f419f0728e6a889e930bd3868673880. --- src/lib/snack-bar/snack-bar.spec.ts | 8 +++++--- src/lib/snack-bar/snack-bar.ts | 6 ++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/snack-bar/snack-bar.spec.ts b/src/lib/snack-bar/snack-bar.spec.ts index 21fc199a7bb5..2a65a919a07e 100644 --- a/src/lib/snack-bar/snack-bar.spec.ts +++ b/src/lib/snack-bar/snack-bar.spec.ts @@ -186,16 +186,18 @@ describe('MatSnackBar', () => { })); - it('should clear the announcement message if it is the same as main message', fakeAsync(() => { + it('should default to the passed message for the announcement message', fakeAsync(() => { spyOn(liveAnnouncer, 'announce'); - snackBar.open(simpleMessage, undefined, {announcementMessage: simpleMessage}); + snackBar.open(simpleMessage); viewContainerFixture.detectChanges(); expect(overlayContainerElement.childElementCount) .toBe(1, 'Expected the overlay with the default announcement message to be added'); - expect(liveAnnouncer.announce).not.toHaveBeenCalled(); + // Expect the live announcer to have been called with the display message and some + // string for the politeness. We do not want to test for the default politeness here. + expect(liveAnnouncer.announce).toHaveBeenCalledWith(simpleMessage, jasmine.any(String)); })); it('should be able to specify a custom announcement message', fakeAsync(() => { diff --git a/src/lib/snack-bar/snack-bar.ts b/src/lib/snack-bar/snack-bar.ts index 84d1293f66b7..d2028d0dd1bb 100644 --- a/src/lib/snack-bar/snack-bar.ts +++ b/src/lib/snack-bar/snack-bar.ts @@ -114,10 +114,8 @@ export class MatSnackBar implements OnDestroy { // override the data to pass in our own message and action. _config.data = {message, action}; - // Since the snack bar has `role="alert"`, we don't - // want to announce the same message twice. - if (_config.announcementMessage === message) { - _config.announcementMessage = undefined; + if (!_config.announcementMessage) { + _config.announcementMessage = message; } return this.openFromComponent(SimpleSnackBar, _config); From a7917c046189a6aec9f949340672856fb0430de2 Mon Sep 17 00:00:00 2001 From: vivian-hu <41269630+vivian-hu@users.noreply.github.com> Date: Thu, 13 Dec 2018 10:57:50 -0800 Subject: [PATCH 10/12] Revert "feat(drag-drop): allow entire group of drop lists to be disabled (#14179)" This reverts commit 94e76de1e1c7e7976a79fd8e744af5433e8f5eb9. From 09db9ccc47ba4dc1236765c97095708d6e8828b7 Mon Sep 17 00:00:00 2001 From: vivian-hu <41269630+vivian-hu@users.noreply.github.com> Date: Thu, 13 Dec 2018 10:57:50 -0800 Subject: [PATCH 11/12] Revert "fix(drag-drop): prevent text selection while dragging on Safari (#14405)" This reverts commit 220e3885f254740c3036f87ded4b5e5f9f07ea40. From 553a0b7698a8c450cddc6dc6d4e420f14d59e398 Mon Sep 17 00:00:00 2001 From: vivian-hu <41269630+vivian-hu@users.noreply.github.com> Date: Thu, 13 Dec 2018 10:57:50 -0800 Subject: [PATCH 12/12] 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 f0d1aae55a87..ea86763a5722 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 42038e56fe7b..143ea70c8f00 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();