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

When DepartmentSelect is focused label and bottom line disappear #3

Closed
davidfdriscoll opened this issue Apr 2, 2021 · 2 comments
Closed

Comments

@davidfdriscoll
Copy link
Owner

davidfdriscoll commented Apr 2, 2021

Unfocused:
image

Focused:
image

When focused the label receives the color theme.palette.primary.main, which fades into background.
image

@davidfdriscoll
Copy link
Owner Author

It would be better for it to receive the color theme.palette.primary.dark, as in this demo.
image

@davidfdriscoll
Copy link
Owner Author

Instead switched to secondary palette, but in general these are helpful for targeting pseudoclasses:

https://medium.com/the-clever-dev/override-textfield-border-color-for-different-states-in-material-ui-2b61590d89ab
mui/material-ui#11244

I found this worked:

const useStyles = makeStyles((theme) => ({
root: {
'&$focused': {
color: theme.palette.primary.dark,
},
},
focused: {},
}));

...

<InputLabel
id="select-label"
classes={{
root: classes.root,
focused: classes.focused,
}}

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

No branches or pull requests

1 participant