I am having a AppBar with IconButton in it. While hovering the button it shows a oval hover in it . I tried to disable it by giving
disableFocusRipple={true}
But it doesnt works.Please help me with that.
For some reason none of the disableRipple properties has worked for me, but I was able to disable ripple effect on an IconButton by just making its hover background colour transparent.
While searching the solution for same question in case of react material UI, if someone stumbles upon this page like me, Quick way to remove ripple from a React MaterialUI Button component is to add "disableRipple" attribute.
You might use the property disableRipple
. if true it will disable the ripple effect. disableFocusRipple
only works when disableRipple
is true. But you have a price on that. You loose some state styles.
Take a look at the API docs. https://material-ui.com/api/button/
For some reason none of the disableRipple
properties has worked for me, but I was able to disable ripple effect on an IconButton
by just making its hover background colour transparent.
Code:
<IconButton className={classes.disableRipple} aria-label="View">
<InfoIcon/>
</IconButton>
Then just style it like so (or any other way you want to style it, can be inline):
const useStyles = makeStyles(() => ({
disableRipple: {
'&:hover': {
backgroundColor: 'transparent',
},
},
}));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With