-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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] Match the new specification #15122
[Snackbar] Match the new specification #15122
Conversation
@material-ui/core: parsed: +Infinity% , gzip: +Infinity% Details of bundle changes.Comparing: 03e01e3...e735fe2
|
b89cf43
to
61488d4
Compare
Added detailed changes to the PR description. Could you correct them if they're wrong/incomplete? Helps people evaluating that change. |
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.
https://deploy-preview-15122--material-ui.netlify.com/demos/snackbars/#consecutive-snackbars is now outdated. There is no more downwards/upwards movement.
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 prefer the old look of the 'Snackbars and floating action buttons (FABs)' demo which matches the other demos on the page but LGTM
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.
Looks like the comment for the Slide component needs to be changed https://github.com/mui-org/material-ui/blob/bbfbb0ca6917475e196efc21e826e868d630e75e/packages/material-ui/src/Slide/Slide.js#L73
For the 'Snackbars and floating action buttons (FABs)' I think it would be preferable to show this at mobile width, so that it matches the new behaviour shown in the spec, regardless of the width of the browser. At first glance it is hard to see what is being demonstrated. Alternatively, a toggle to switch the width, although that would muddy the distinction between what is required to implement the behavior, vs what is required to demo it. Also, the app bar title "Out of my way" no longer makes sense, as the snackbar isn't now "pushing" the Fab out of the way. |
2755c00
to
45bf57f
Compare
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 still prefer the old look of the 'Snackbars and floating action buttons (FABs)' demo which matches the other demos on the page (text button on a grey background) but LGTM
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.
- The "Open snackbar" button didn't used to have a background, in order to to separate it from the "App":
Now it looks like it's a part of the "App", with the AppBar pushed down:
-
The previous width looked more like that of a mobile app.
-
Previously mentioned:
Also, the app bar title "Out of my way" no longer makes sense, as the snackbar isn't now "pushing" the Fab out of the way.
I have a better idea. |
b066c64
to
6953f95
Compare
@mbrookes Could you confirm it's good now? |
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.
Not all a direct result of this PR, but here are few observations from looking at the rest of the demos:
Customized:
The "Open success snackbar" button isn't obviously a button. Would an outlined outlined button be better?
Positioned:
After opening the first snackbar, the rest don't get an opening transition.
Control Direction:
Says "Slide is the default transition." This is no longer the case.
Change Transition:
Demos Slide, which is already shown in the Control Direction demo. Demos Grow, which is the default transition.
notistack:
The revised spec says not to stack snackbars, so if we're keeping this demo, the text should perhaps mention that.
@mbrookes Thanks, it should be taken care of. |
Just this one left:
|
Why do you want to remove it? The concerns are different, one is about changing the transition, the other about changing the Slide direction. |
If the default transition is not Slide anymore is it really that important to have an example about the direction? This is more a concern for Slide demos.
I would keep that there (maybe add a "this is default" hint) for easier comparison. |
I'm on it 👍
I'm wondering too, but I believe it's something common. |
Except that it isn't actually just showing the default, it's "replacing" the default transition (Grow) with Grow. As a code example it's... odd. |
Sure we don't have to explicitly define it. That's rather nitpicky though. I would rather focus on the actual demo: Do you agree that we should include the defeault transition in the demo? |
I lean towards the simplest demo that shows the particular feature or function, in this case using a custom transition. But if you believe having the side-by-side comparison is helpful, then sure. |
a6cd990
to
a8a9898
Compare
a8a9898
to
e735fe2
Compare
Sorry for commenting on an old PR, but was this the PR that removed full-width snackbars on mobile? |
Yes |
Closes #14785. I had a few changes to make to match the specification.
The new specification: https://material.io/design/components/snackbars.html.
Breaking changes
Grow
instead ofSlide
.