File tree Expand file tree Collapse file tree 3 files changed +17
-15
lines changed Expand file tree Collapse file tree 3 files changed +17
-15
lines changed Original file line number Diff line number Diff line change 8
8
background : mat-color ($background , card );
9
9
color : mat-color ($foreground , text );
10
10
11
- .mat-option {
12
- // Selected options in autocompletes should not be gray, but we
13
- // only want to override the background for selected options if
14
- // they are *not* in hover or focus state. This change has to be
15
- // made here because base option styles are shared between the
16
- // autocomplete and the select.
17
- & .mat-selected :not (.mat-active ):not (:hover ) {
18
- background : mat-color ($background , card );
11
+ // Selected options in autocompletes should not be gray, but we
12
+ // only want to override the background for selected options if
13
+ // they are *not* in hover or focus state. This change has to be
14
+ // made here because base option styles are shared between the
15
+ // autocomplete and the select.
16
+ .mat-option.mat-selected :not (.mat-active ):not (:hover ) {
17
+ background : mat-color ($background , card );
18
+
19
+ & :not (.mat-option-disabled ) {
19
20
color : mat-color ($foreground , text );
20
21
}
21
22
}
Original file line number Diff line number Diff line change 12
12
.mat-option {
13
13
color : mat-color ($foreground , text );
14
14
15
- & :hover:not (.mat-option-disabled ), & :focus:not (.mat-option-disabled ) {
15
+ & :hover:not (.mat-option-disabled ),
16
+ & :focus:not (.mat-option-disabled ) {
16
17
background : mat-color ($background , hover );
17
18
}
18
19
19
- .mat-primary & .mat-selected {
20
+ .mat-primary & .mat-selected :not ( .mat-option-disabled ) {
20
21
color : mat-color ($primary );
21
22
}
22
23
23
- .mat-accent & .mat-selected {
24
+ .mat-accent & .mat-selected :not ( .mat-option-disabled ) {
24
25
color : mat-color ($accent );
25
26
}
26
27
27
- .mat-warn & .mat-selected {
28
+ .mat-warn & .mat-selected :not ( .mat-option-disabled ) {
28
29
color : mat-color ($warn );
29
30
}
30
31
31
32
// In multiple mode there is a checkbox to show that the option is selected.
32
- & .mat-selected :not (.mat-option-multiple ) {
33
+ & .mat-selected :not (.mat-option-multiple ):not ( .mat-option-disabled ) {
33
34
background : mat-color ($background , hover );
34
35
}
35
36
Original file line number Diff line number Diff line change 1
1
< span [ngSwitch] ="_isCompatibilityMode " *ngIf ="multiple ">
2
2
< mat-pseudo-checkbox class ="mat-option-pseudo-checkbox " *ngSwitchCase ="true "
3
- [state] ="selected ? 'checked' : '' "> </ mat-pseudo-checkbox >
3
+ [state] ="selected ? 'checked' : '' " [disabled] =" disabled " > </ mat-pseudo-checkbox >
4
4
< md-pseudo-checkbox class ="mat-option-pseudo-checkbox " *ngSwitchDefault
5
- [state] ="selected ? 'checked' : '' "> </ md-pseudo-checkbox >
5
+ [state] ="selected ? 'checked' : '' " [disabled] =" disabled " > </ md-pseudo-checkbox >
6
6
</ span >
7
7
8
8
< ng-content > </ ng-content >
You can’t perform that action at this time.
0 commit comments