-
-
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
autoHideDuration option doesn't work #267
Comments
iamhosseindhv
added a commit
that referenced
this issue
May 17, 2020
iamhosseindhv
added a commit
that referenced
this issue
May 17, 2020
Thanks @lukawski . Docs have been updated. You can pass Fix is available in |
Thanks a lot. |
Setting |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected Behavior
According to docs -
Set autoHideDuration to 'undefined' if you don't want snackbars to automatically close
- snackbar should not be closed automatically whenautoHideDuration
is set toundefined
.Current Behavior
Snackbar closes automatically after 5000 ms when
autoHideDuration
is set toundefined
. SnackbarProvider.tsx - here you can see condition which decides what to set insnack.autoHideDuration
. It's using||
operator so when this prop is undefined it'll fallback to5000
. Perhaps this condition could be changed so it checks forundefined
explicitly. Or maybe docs needs to be update if it's desired behavior? I know aboutpersist
option but currently docs are a bit misleading.Steps to Reproduce
Link: https://codesandbox.io/s/serene-mccarthy-olvk4?file=/MessageButtons.js:1261-1276
enqueueSnackbar
withautoHideDuration
set to undefinedContext
I want my snackbar not to be closed automatically but manually.
Your Environment
Thanks for great library, it's really useful and I really enjoy using it!
The text was updated successfully, but these errors were encountered: