Skip to content

Commit e4c00ad

Browse files
committed
review changes
1 parent 9b58c38 commit e4c00ad

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/material/list/_list-theme.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@
3434
}
3535
}
3636

37-
.mat-list-option.mat-single-selected {
38-
background: mat-color($background, hover, 0.12);
37+
.mat-list-single-selected-option {
38+
&, &:hover, &:focus {
39+
background: mat-color($background, hover, 0.12);
40+
}
3941
}
4042
}
4143

src/material/list/selection-list.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import {
4040
SimpleChanges,
4141
ViewChild,
4242
ViewEncapsulation,
43+
isDevMode,
4344
} from '@angular/core';
4445
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';
4546
import {
@@ -109,7 +110,7 @@ export class MatSelectionListChange {
109110
// be placed inside a parent that has one of the other colors with a higher specificity.
110111
'[class.mat-accent]': 'color !== "primary" && color !== "warn"',
111112
'[class.mat-warn]': 'color === "warn"',
112-
'[class.mat-single-selected]': 'selected && !selectionList.multiple',
113+
'[class.mat-list-single-selected-option]': 'selected && !selectionList.multiple',
113114
'[attr.aria-selected]': 'selected',
114115
'[attr.aria-disabled]': 'disabled',
115116
},
@@ -384,7 +385,7 @@ export class MatSelectionList extends _MatSelectionListMixinBase implements CanD
384385
const newValue = coerceBooleanProperty(value);
385386

386387
if (newValue !== this._multiple) {
387-
if (this._contentInitialized) {
388+
if (isDevMode() && this._contentInitialized) {
388389
throw new Error(
389390
'Cannot change `multiple` mode of mat-selection-list after initialization.');
390391
}

0 commit comments

Comments
 (0)