Skip to content

Commit fb002af

Browse files
[Select] Apply disabled color to the icon (#20287)
* [NativeSelect] fix icon color on disabled state * [Autocomplete] unify disabled icon color handling with NativeSelect * [Autocomplete] Handle clear icon for consistency * color instead of opacity? Co-authored-by: Olivier Tassinari <[email protected]>
1 parent ac25d40 commit fb002af

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

packages/material-ui-lab/src/Autocomplete/Autocomplete.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ export const styles = (theme) => ({
134134
clearIndicator: {
135135
marginRight: -2,
136136
padding: 4,
137-
color: theme.palette.action.active,
138137
visibility: 'hidden',
139138
},
140139
/* Styles applied to the clear indicator if the input is dirty. */
@@ -143,7 +142,6 @@ export const styles = (theme) => ({
143142
popupIndicator: {
144143
padding: 2,
145144
marginRight: -2,
146-
color: theme.palette.action.active,
147145
},
148146
/* Styles applied to the popup indicator if the popup is open. */
149147
popupIndicatorOpen: {

packages/material-ui/src/NativeSelect/NativeSelect.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,11 @@ export const styles = (theme) => ({
7272
position: 'absolute',
7373
right: 0,
7474
top: 'calc(50% - 12px)', // Center vertically
75-
color: theme.palette.action.active,
7675
pointerEvents: 'none', // Don't block pointer events on the select under the icon.
76+
color: theme.palette.action.active,
77+
'&$disabled': {
78+
color: theme.palette.action.disabled,
79+
},
7780
},
7881
/* Styles applied to the icon component if the popup is open. */
7982
iconOpen: {

packages/material-ui/src/NativeSelect/NativeSelectInput.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ const NativeSelectInput = React.forwardRef(function NativeSelectInput(props, ref
3535
{...other}
3636
/>
3737
{props.multiple ? null : (
38-
<IconComponent className={clsx(classes.icon, classes[`icon${capitalize(variant)}`])} />
38+
<IconComponent
39+
className={clsx(classes.icon, classes[`icon${capitalize(variant)}`], {
40+
[classes.disabled]: disabled,
41+
})}
42+
/>
3943
)}
4044
</React.Fragment>
4145
);

packages/material-ui/src/Select/SelectInput.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ const SelectInput = React.forwardRef(function SelectInput(props, ref) {
349349
<IconComponent
350350
className={clsx(classes.icon, classes[`icon${capitalize(variant)}`], {
351351
[classes.iconOpen]: open,
352+
[classes.disabled]: disabled,
352353
})}
353354
/>
354355
<Menu

0 commit comments

Comments
 (0)