-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[Snackbar] Add a maxWidth property #12327
Conversation
@simoami Looks good! Could you perhaps add spacing between the buttons following https://material-ui.com/demos/buttons/#text-buttons (and also for the CustomizedTooltips example)? |
## Customized Tooltips | ||
|
||
{{"demo": "pages/demos/tooltips/CustomizedTooltips.js"}} | ||
|
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.
Any particular reason for the change in order? Where we have customization examples they tend to come last.
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.
@mbrookes Trust is, I'm very hesitant to have this property. From my point of view, the main value of this pull request comes from the default value it's setting: max-width: 300
.
Regarding having a dedicated property for that? Well, why not using CSS override?
I have the intuition that people will be more interested in the Customized Tooltips
tooltip demo than in the max-width. Benchmarking the other tooltip implementations, I have seen very few having this type of customization. Anyway. I want to add analytics on the live documentation regarding demos usage. I think that we should sort the demos, when possible by their popularity, so overall, people scroll less in the pages to find what they are looking for.
What do you think?
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.
@oliviertassinari If it helps, I always scroll to the bottom and love viewing all the demos down to the last one :). Another way to know is to gauge the number of user questions that can be associated with not seeing the demos at the bottom. Do you ever have to say "Scroll down to the last demo example" and how often?
I also inserted the demo example before the last one on purpose, because it pertains to what is now a new standard property. It seemed odd to talk about css customization then document a basic property last. This is a shift from the pattern I'm used to see elsewhere.
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.
@simoami Oh, Interesting habit, I'm not the only one to start at the bottom then!
That's a fair point. I appreciate the effort that @simoami has put in to this PR, but perhaps it should just be a customisation example instead. |
Well, there's a certain order to them at the moment; simplistically: basic functionality, advanced functionality, customization – but within that there's certainly some room to rearrange things. Perhaps the TOC for each page that we discussed previously is another way to reduce the need to scroll? Even a basic TOC would be better than none, although I do like your idea of a TOC that highlights the current section. |
@oliviertassinari @mbrookes |
A sensible default along with a customization example would be perfect. 👍 |
@mbrookes Yes, having a TOC, if well executed, can be a significant improvement!
@simoami Same logic for the Popper component. I don't know. It's a bolder move than with the Tooltip.
I love this plan :). One step at a time. If people complain more about this use case, we add a property. |
@mbrookes @oliviertassinari One more question: do you want to see a new section for max-width customization or an extra demo block under "Customized Tooltips" ? |
I don't have a strong opinion on the default, but given that tooltips are meant to be short, perhaps narrower than 300?
It might be worthwhile to show the default alongside the customization, which would suggest its own section. @oliviertassinari, thoughts? |
As you guys see fit. I see some value in a 200px vs 300px min-width as well as two demos vs a single demo. |
@mbrookes @oliviertassinari Take 2: #12338 |
Closing in favor of #12338 |
maxWidth
parameter to specify the maximum width of the tooltip.maxWidth={0}
to suppress the width constraint.