Skip to content

Commit d840150

Browse files
committed
fix(select): wrong cursor on disabled select
* Fixes some area of a disabled select having a `cursor: pointer`. * Replaces the `mat-disabled` class on the form field underline with a `mat-form-field-disabled` class on the form field itself to allow for easier styling. Fixes #7695.
1 parent 2361983 commit d840150

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

src/lib/form-field/_form-field-theme.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@
5555

5656
.mat-form-field-underline {
5757
background-color: $underline-color;
58+
}
5859

59-
&.mat-disabled {
60-
@include mat-control-disabled-underline($underline-color);
61-
}
60+
.mat-form-field-disabled .mat-form-field-underline {
61+
@include mat-control-disabled-underline($underline-color);
6262
}
6363

6464
.mat-form-field-ripple {

src/lib/form-field/form-field.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535
</div>
3636
</div>
3737

38-
<div class="mat-input-underline mat-form-field-underline" #underline
39-
[class.mat-disabled]="_control.disabled">
38+
<div class="mat-input-underline mat-form-field-underline" #underline>
4039
<span class="mat-input-ripple mat-form-field-ripple"
4140
[class.mat-accent]="color == 'accent'"
4241
[class.mat-warn]="color == 'warn'"></span>

src/lib/form-field/form-field.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ $mat-form-field-underline-height: 1px !default;
148148
// Prevents underline from disappearing at lower zoom levels.
149149
transform: perspective(1px);
150150

151-
&.mat-disabled {
151+
.mat-form-field-disabled & {
152152
background-position: 0;
153153
background-color: transparent;
154154
}

src/lib/form-field/form-field.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ let nextUniqueId = 0;
7575
'[class.mat-form-field-invalid]': '_control.errorState',
7676
'[class.mat-form-field-can-float]': '_canPlaceholderFloat',
7777
'[class.mat-form-field-should-float]': '_control.shouldPlaceholderFloat || _shouldAlwaysFloat',
78+
'[class.mat-form-field-disabled]': '_control.disabled',
7879
'[class.mat-focused]': '_control.focused',
7980
'[class.mat-primary]': 'color == "primary"',
8081
'[class.mat-accent]': 'color == "accent"',

src/lib/select/select.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ $mat-select-placeholder-arrow-space: 2 * ($mat-select-arrow-size + $mat-select-a
7878
}
7979

8080
.mat-form-field-type-mat-select {
81-
.mat-form-field-flex {
81+
&:not(.mat-form-field-disabled) .mat-form-field-flex {
8282
cursor: pointer;
8383
}
8484

0 commit comments

Comments
 (0)