-
-
Notifications
You must be signed in to change notification settings - Fork 298
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 props not honored on smaller screens #367
Comments
I've noticed this issue as well. It seems to be a CSS problem, you can add a class to the providers configuration to bypass this issue. For the case in your screenshot I would do the following:
|
Thanks! Will try that. |
I noticed this issue and the fix will be published soon. In the meantime, it's the const useStyles = makeStyles((theme) => ({
container: {
[theme.breakpoints.down('xs')]: {
'& .MuiCollapse-container, .MuiCollapse-container .MuiCollapse-wrapper .MuiCollapse-wrapperInner': {
width: "100%" // occupy full-width on xs screens
}
}
},
}));
const classes = useStyles();
return (
<SnackbarProvider
maxSnack={3}
anchorOrigin={{ vertical: "bottom", horizontal: "center" }}
classes={{
containerRoot: classes.container
}}
>
<MyApp />
</SnackbarProvider>
) |
I unfortunately had no luck with neither of those solutions at first but when I changed |
This didn't work for me at first. However after a minor modification it is now working! Thanks for that! const useStyles = makeStyles((theme) => ({
container: {
[theme.breakpoints.down("xs")]: {
"& .MuiCollapse-container, .MuiCollapse-container .MuiCollapse-wrapper .MuiCollapse-wrapperInner": {
width: "100%" // occupy full-width on xs screens
}
}
}
}));
|
Here's my hotfix (note: only for 100% 📱 projects, 🚫 🖥): .MuiCollapse-wrapperInner {
// notistack broke mobile snackbar widths
// remove once fixed: https://github.com/iamhosseindhv/notistack/issues/367
width: 100% !important;
} |
This is fixed in the latest release |
@iamhosseindhv I just tested on mine and I am getting the same problem :( I just had a look through the inspector and I can see width:100% being set however it is overwritten to width:"auto" by the className .SnackbarItem-collapseWrapperInner-63 |
I also confirm 1.0.6 is working for me. |
I think a screenshot of notistack documentation website will best describe the problem:
The notification appears to the left of the screen, instead should be in center as selected.
The text was updated successfully, but these errors were encountered: