Autohide Snackbar when autoHideDuration's value be set.
did not autohide Snackbar.
| Tech | Version |
|--------------|---------|
| Material-UI | 1.0.0-beta.23 |
| React | 16.0.0 |
| browser | chrome 62.0.3202.94 (Official Build) (64-bit) |
| etc | |
You don't use handleClose anywhere in your code. You need to add this to your snackbar:
onClose={this.handleClose}
@evantrimboli is right. We need to make the property description more precise. I'm assuming that "automatically" is confusing people.
@evantrimboli . Actually, I tried that method before but not working.
After pulling this issue I update the React to version 16.2.0 and M-UI to version 1.0.0-beta.25. then. the world is more beautiful :)
thanks @oliviertassinari 's answer in #9624 . I used disableTriggerFocus resolve my problem (but i cant find disableRestoreFocus of the dialog in API ).
but i cant find disableRestoreFocus of the dialog in API
Wait the next beta release.
Same issue with Material UI 3.1.1: it does not hide after the duration.
If it does need handleClose it should be clearer, you'd think autoHideDuration would be enough to auto hide it.
@paulcredmond it should be explained in the property description. What would you change?
It's explained there, but might be worth mentioning in the demo.
@paulcredmond Sure, a note about it in the documentation won't harm. Do you want to edit it? :)
It didn't work for me too...
I did a trick with the message:

on my father component I did:
setTimeout(() => this.setState({ message: '' }), 6000);
The message disappears after 6 seconds.
Most helpful comment
Same issue with Material UI 3.1.1: it does not hide after the duration.