You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project is awesome, and has saved me a ton of time setting up notifications in a webapp I'm working on, but there's one small quirk I noticed. I set up an "is the browser offline" listener that displays a persistent alert if the answer is yes. It works great, but it eats up one of the maxSnack slots even though I'm setting it to persistent and displaying it with a different anchor origin. It would be great if there was a way to tell enqueueSnackbar "hey, don't count this one towards the limit". I don't think it's likely to be an actual problem in practice since we're usually only going to have one normal alert at a time anyway, but it still seems like a missing feature from this otherwise amazingly customizable package.
The text was updated successfully, but these errors were encountered:
@simon-abbott Each SnackbarProvider enforces its own maxSnack limit. So depending on your requirements, you might be able to simply use 2 SnackbarProviders, one* dedicated to "browser offline listener", the other dedicated to other types of notifications.
If you do this, make sure you show snackbars by using enqueueSnackbar from useSnackbar.
P.S: This workaround works better if your "browser offline listener" snackbars are positioned differently from other types of snackbars. For example, use bottom-center as anchorOrigin for these notifications, and stick to bottom-left for other types of notifications.
Either way I understand non of these are ideal, but thought I'd share :)
This project is awesome, and has saved me a ton of time setting up notifications in a webapp I'm working on, but there's one small quirk I noticed. I set up an "is the browser offline" listener that displays a persistent alert if the answer is yes. It works great, but it eats up one of the
maxSnack
slots even though I'm setting it to persistent and displaying it with a different anchor origin. It would be great if there was a way to tellenqueueSnackbar
"hey, don't count this one towards the limit". I don't think it's likely to be an actual problem in practice since we're usually only going to have one normal alert at a time anyway, but it still seems like a missing feature from this otherwise amazingly customizable package.The text was updated successfully, but these errors were encountered: