I can't access the width of the material-ui snackbar. When I use bodyStyle property and change height the app is updated accordingly. But why is width not changing?
Asked
Active
Viewed 3,790 times
1
-
You can do it through custom layout.. [here] (http://stackoverflow.com/a/33441214/5456671) – Muhammad Jamal Nov 23 '16 at 08:58
-
thank you, but the example is for android. I am using it in web application in react. – jssql Nov 23 '16 at 15:50
2 Answers
2
You should add bodyStyle
attribute with maxWidth
and height
, e.g.:
<Snackbar bodyStyle={{ maxWidth: '100%', height: 'auto' }} ... />

marcelovca90
- 2,673
- 3
- 27
- 34

Alwin
- 153
- 1
- 6
0
Use the bodyStyle property, and set flexGrow to zero (material-ui has it set to 1 which is overriding the width):
<Snackbar message="BIG snack" bodyStyle={{ height: 200, width: 200, flexGrow: 0 }} open />

Jeff McCloud
- 5,777
- 1
- 19
- 21