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

[ButtonBase] Enable pointer-events #23101

Closed
wants to merge 2 commits into from

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Oct 16, 2020

@eps1lon eps1lon added the component: ButtonBase The React component. label Oct 16, 2020
@mui-pr-bot
Copy link

@material-ui/core: parsed: +0.13% , gzip: +0.05%
@material-ui/lab: parsed: +0.15% , gzip: +0.04%

Details of bundle changes

Generated by 🚫 dangerJS against d15a057

Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

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

Should the PR be in a draft mode?


The initial fix comes from #8416 (comment). Then it was improved with:

@@ -20,7 +20,7 @@ export const styles = (theme) => ({
duration: theme.transitions.duration.short,
},
),
'&:hover': {
'&:hover:not($disabled)': {
Copy link
Member

Choose a reason for hiding this comment

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

not() increases the specificity => harder customizations. We had iterations in the past to remove them, e.g. #14953. What's the use case for the change?

Copy link
Member Author

Choose a reason for hiding this comment

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

To not be a breaking change.

Copy link
Member Author

Choose a reason for hiding this comment

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

This might be overzealous i.e. not needed in every case. I just noticed it for Button.

Copy link
Member Author

Choose a reason for hiding this comment

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

not() increases the specificity => harder customizations.

Not every increase in specificity is bad. You have to show me an existing customization (that is still valid with this change) that is no longer possible due to an increase in specificity.

Copy link
Member

@oliviertassinari oliviertassinari Oct 16, 2020

Choose a reason for hiding this comment

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

Sure, here is an example https://deploy-preview-23101--material-ui.netlify.app/guides/interoperability/#plain-css, a button that customizes the hover state. The hover state is wrong.

expect(() => {
render(
<Tooltip title="Hello World">
<button type="submit" disabled>
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand. This still doesn't work. Why remove the warning?
https://codesandbox.io/s/simpletooltips-material-demo-forked-s1pqe?file=/demo.tsx

Copy link
Member Author

@eps1lon eps1lon Oct 16, 2020

Choose a reason for hiding this comment

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

I can't stress enough how useless these reviews are. Please describe the steps to reproduce, the expected behavior, the actual behavior and your environment. Same concern with your behavior as #23088 (comment)

The tooltip is working for me fine as far as I can tell with all the examples but I didn't do any browser testing yet.

Copy link
Member

@oliviertassinari oliviertassinari Oct 16, 2020

Choose a reason for hiding this comment

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

I'm not reporting a bug. I'm providing a demonstration that the removed test case is still relevant, that we need to keep it.

  • environment: Chrome, Edge
  • steps to reproduce: hover the button
  • expect/actual behavior, don't apply. I'm not reporting a bug.

The codesandbox renders the test case. It demonstrates that the tooltip doesn't display. It also demonstrates that the instruction in the documentation should be kept as they allow the tooltip to open.

Does the PointerEvent API address this?

@eps1lon
Copy link
Member Author

eps1lon commented Oct 16, 2020

Should the PR be in a draft mode?

👍 Yes

@eps1lon eps1lon marked this pull request as draft October 16, 2020 20:59
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 22, 2020
@eps1lon eps1lon reopened this Dec 15, 2020
@vercel
Copy link

vercel bot commented Dec 15, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/mui-org/material-ui/g9e8kxkys
✅ Preview: https://material-ui-git-feat-buttonenable-pointer-events.mui-org.vercel.app

@eps1lon
Copy link
Member Author

eps1lon commented Jan 14, 2021

Prioritizing pickers at the moment. Changing this might be a bit too disruptive. Would be an easy choice when we would restart. Disabling pointer-events for disabled components has unintended consequences.

@eps1lon eps1lon closed this Jan 14, 2021
@eps1lon eps1lon deleted the feat/Button/enable-pointer-events branch September 14, 2021 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ButtonBase The React component. PR: out-of-date The pull request has merge conflicts and can't be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Pagination] clicking on disabled arrows autoselects unrelated things
3 participants