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

[IconButton] Remove on hover effect when disableRipple is set #29298

Merged
merged 4 commits into from
Nov 22, 2021

Conversation

adamfitzgibbon
Copy link
Contributor

Added a check for the disableRipple prop before adding the on-hover background color styling.

Addresses #11108

@mui-pr-bot
Copy link

mui-pr-bot commented Oct 26, 2021

Details of bundle changes

Generated by 🚫 dangerJS against b357809

Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

👌

Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Actually we need some updates sorry :)

@adamfitzgibbon
Copy link
Contributor Author

Made your requested updates @mnajdova

@adamfitzgibbon
Copy link
Contributor Author

I made a couple more changes, can you take a look when you get the chance? @mnajdova

@adamfitzgibbon
Copy link
Contributor Author

Hey @mnajdova is this good to go?

@mbrookes mbrookes added the component: icon button This is the name of the generic UI component, not the React module! label Nov 12, 2021
@adamfitzgibbon
Copy link
Contributor Author

Hey @mnajdova bumping this one more time in an attempt to make my Hacktoberfest goal before the deadline. Hoping you can give it another look :)

@mnajdova
Copy link
Member

Hey @mnajdova bumping this one more time in an attempt to make my Hacktoberfest goal before the deadline. Hoping you can give it another look :)

So sorry was a bit busy, the notification must have slipped. All good from my end.

@mnajdova mnajdova merged commit 65fe2dc into mui:master Nov 22, 2021
@mnajdova mnajdova changed the title [IconButton] remove on hover effect when disableRipple is set [IconButton] Remove on hover effect when disableRipple is set Nov 22, 2021
@dxh-sc
Copy link

dxh-sc commented Jul 5, 2022

the version of 5.8.6 can works now?

</IconButton>,
);
expect(container.querySelector('.touch-ripple')).to.equal(null);
expect(getComputedStyle(getByRole('button'), ':hover').backgroundColor).to.equal(
Copy link
Member

@oliviertassinari oliviertassinari Oct 14, 2022

Choose a reason for hiding this comment

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

This :hover argument is not valid for the getComputedStyle(element, pseudoElt) API. The second parameter expects a pseudo-element, not a pseudo-class, see https://stackoverflow.com/questions/11495535/why-doesnt-getcomputedstyle-work-with-pseudo-classes-like-hover.

It seems that we can't test this. I'm removing the test in: #34764 as it's always true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: icon button This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants