-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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] Document how to use cursor not-allowed #17778
[ButtonBase] Document how to use cursor not-allowed #17778
Conversation
No bundle size changes comparing 2b9d278...c00a3f3 |
3e054e3
to
b995ed5
Compare
@slipmat Let me know what you think. Changing the DOM structure wasn't an option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather advise wrapping a span around it and add the cursor there. Otherwise polyfilling pointer-events: none; is quite difficult.
https://codesandbox.io/s/material-ui-disabled-button-cursor-not-allowed-01i69
@eps1lon Oh great, we can explain this approach too 👍 . The use of "rather" confuses me. This seems to be a complementary solution. We should be able to leverage |
No it's meant as an alternate. Your solution implies a polyfilled behavior of pointer-events: none. Please be aware that "not allowed" and "disabled" are different concepts. The assumption that you can just mix these concepts is wrong. |
Agree, I have changed to wording to explicit that these are two different options.
I think that it depends of the cases, In this proposal:
|
Option 1 hides an actual bug in your UI though. That has nothing to do with some 80/20 use case but with how much you're ok with a broken UI. I really can't help anyone if a simple wrapper is already to much work to do. If that's your issue then why even go out of your way and add a different cursor. Work is ok up to N but N + 1 is all of the sudden not workable?
What cases? |
What do you mean by broken UI?
My concern is how would developers deploy the solution, at scale (in all their pages)? I have seen a push back from the developers any time creating a wrapper and reexporting it from our components is required. I would like to avoid it. I believe we can ask @andyford. How did you solve the problem, in the end?
What I mean is that some design systems mix the two, e.g. Blueprint. |
Hey, in the end our team decided to use a different UI library ... not because of this topic, but becuase we decided to go with a more bare-bones approach. So unfortunately I never solved this |
@andyford Thanks for sharing. Can we learn more about the tradeoff your team took? I could help us in the future. What solution did you pick? What do you mean by bare-bones? |
In a general sense, we were deciding between 2 options:
we chose option 2 because our app isn't super huge and we predicted (whether correct or not) that we would be spending more time to learn a UI lib and override it with our specific brand styles than we would if we wrote our stuff kinda from scratch (but with small helper libs) For our small public-facing app which requires specific branding, I think we made the right choice. However we would pick Material UI (or something similar) in a hearbeat for an internal admin app which didn't need any (or very much) custom styling. EDIT: we don't have anything against Material UI (in fact we are quite impressed), but we felt it was more than we needed for our particular use-case |
@andyford Awesome! We are trying to break out people's perception of "Material-UI" from "Material Design UI" to "material to build UI". I'm super interested in learning about the other low-level tools you have used in the process. For instance, did you consider using some of our lower level helpers? Modal, Clickaway, Portal, useMediaQuery, TextareAutosize, system, and soon Autocomplete, Dropzone, etc. Among these open issues, which one would you qualify as the most important?
Thanks. |
@slipmat Thanks |
I would say this one (i.e. usage of dynamic theme variants and colours) |
Fixes #14455
Proposal for supporting disabled cursor on Button without breaking links