-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Styling component on focus #74
Comments
Did you solve this? im having the same problem. |
@AlbinCederblad Unfortunately I did not, sorry. I went with the default styling since it wasn't that important for the task back then. But in case you find the solution, please share it, I'm still curious. |
You can listen to onFocus and onBlur.
You can change your state like I did. I have made two css classes, one for the focused one and one "normal" one. @sonicka , what you tried to do was listening to a focus event. Only an input field have a focused event. If you see the code, it will generated some divs with at its core an input field. But that's not what you want I believe. |
|
Hey there!
I'm trying to customize the look of your search bar and I'm stuck on one thing. I'm trying to give it a bottom border that changes color when search bar is focused. I have the bottom border showing, also managed to make it work on hover but it won't work when focused so I'm probably doing something wrong. This is what I tried:
I'm sending this to Search component:
classes={{ root: classes.searchRoot, input: classes.searchInput }}
And classes look like this:
(the commented out lines are my attempts to make it work --- sorry for them, I'm little bit confused about styling components like this so I tried anything I could think of that resembled anything I've read in some tutorials hoping something would work in the end but it didn't sooo here I am)
Thanks in advance for any help.
The text was updated successfully, but these errors were encountered: