[Snackbar] Auto hide timer restarts when parent component re-renders #18353
Labels
bug 🐛
Something doesn't work
component: snackbar
This is the name of the generic UI component, not the React module!
good first issue
Great for first contributions. Enable to learn the contribution process.
Current Behavior 😯
When the parent component re-renders before the autoHideDuration has elapsed, the Snackbar stays open. onClose is not called with the timeout reason.
Expected Behavior 🤔
If the Snackback autoHideDuration and onClose props don't change, it should call onClose with the timeout reason after autoHideDuration passes.
Steps to Reproduce 🕹
Steps:
https://codesandbox.io/s/hidden-waterfall-75ulu
( The Snackbar hides 2000ms after the timer is disabled: https://codesandbox.io/s/fervent-golick-fw1hg )
Your Environment 🌎
The text was updated successfully, but these errors were encountered: