Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Select] Fix specificity of style overrides #25766

Merged
merged 8 commits into from
Apr 19, 2021
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions packages/material-ui/src/Select/SelectInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@ import useForkRef from '../utils/useForkRef';
import useControlled from '../utils/useControlled';
import selectClasses, { getSelectUtilitiyClasses } from './selectClasses';

// TODO: enable overrides for the icon and nativeInput slots via the components prop
mnajdova marked this conversation as resolved.
Show resolved Hide resolved
export const overridesResolver = (props, styles) => {
const { styleProps } = props;
return deepmerge(
{
...styles.select,
mnajdova marked this conversation as resolved.
Show resolved Hide resolved
...styles[styleProps.variant],
[`& .${selectClasses.icon}`]: {
...styles.icon,
...(styleProps.variant && styles[`icon${capitalize(styleProps.variant)}`]),
...(styleProps.open && styles.iconOpen),
},
[`&.${selectClasses.selectMenu}`]: styles.selectMenu,
[`&.${selectClasses[styleProps.variant]}`]: styles[styleProps.variant],
},
styles.root || {},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Referencing #11646 where we plan to simply this

Copy link
Member

@oliviertassinari oliviertassinari Apr 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And #25313, which suggest we have no root on this file so: root, select, selectMenu.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we do this in a separate PR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, yes

);
Expand Down