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

passthrough style-Attribute for Option Component #288

Open
simkea opened this issue Sep 6, 2018 · 2 comments
Open

passthrough style-Attribute for Option Component #288

simkea opened this issue Sep 6, 2018 · 2 comments

Comments

@simkea
Copy link

simkea commented Sep 6, 2018

Is there a way to pass the Style parameter to the option element?
Maybe also a new feature for this component.
I know I can set my own class, but I'd rather use inlinestyles in a suitable place.

<Option
 style={{ color: color, backgroundColor: color }}
 />

br Henry

@amorey
Copy link
Member

amorey commented Sep 14, 2018

@simkea Apologies for the late reply. MUI React passes through inline styles and classNames but the values don't get reflected in the UI because 1) the browser's default <select> widget ignores <option> styles and 2) the MUI custom interface doesn't support it. Can you give an example of what you're trying to do?

If you're interested, you can add support for passthroughs to the custom UI by modifying the code here:
https://github.com/muicss/mui/blob/master/src/react/select.jsx

@simkea
Copy link
Author

simkea commented Sep 17, 2018

I hope you can add the following.
Pass the style attribute for the option to the mui-select__menu > div element.
I don't want to use classes here, because the color values come from a database.

select-optionpanel

Maybe a little feature for your next update. Thx

br
Henry Schorradt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants