Skip to content
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

Add option to persist a notification until dismissed #42

Closed
mckernanin opened this issue Jan 4, 2019 · 4 comments
Closed

Add option to persist a notification until dismissed #42

mckernanin opened this issue Jan 4, 2019 · 4 comments

Comments

@mckernanin
Copy link

I would like to be able to have a notification persist, until manually dismissed by the user. I'm happy to work on this and create a PR, wanted to open an issue first to make sure this is a feature you'd be open to adding.

@iamhosseindhv
Copy link
Owner

Thanks for opening the issue first @mckernanin.

You can set autoHideDuration prop to null or undefined to prevent snackbars from getting dismissed. However, if you've enabled stacking behaviour (i.e. maxSnack > 1), your notification will get dismissed by notistack when maxSnack is reached.

You're welcome to make a PR for these cases. Suggestion implementation is to allow a new option persist: true|false in the options parameter of enqueueSnackbar, and default it to be false.

I'll merge your PR or add support for this myself after 22 Jan (as I'm in the middle of university exams).

@cevr
Copy link

cevr commented Jan 22, 2019

Hi, @iamhosseindhv. Can this be added to the documentation?

@iamhosseindhv
Copy link
Owner

@cevr Support for this feature hasn't been added yet. But of course documentation will be updated once the feature is published.

@iamhosseindhv
Copy link
Owner

Happy to say this feature is now in master and will be published in the next release.
Thanks to @mckernanin for feature request and @butchmarshall for the PR. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants