When calling closeSnackbar shortly after enqueuing, it should get closed.
When closing a snackbar shortly after enqueuing it (0-230ms), it persists and won't get closed.
It seems to work correctly if the entering transition is almost completed, which is round about after 240-250ms.
Enqueue a keyed snackbar and close it shortly (0-230ms) after that.
enqueueSnackbar("Some message", {
key: "test",
persist: true,
variant: "default"
});
window.setTimeout(() => closeSnackbar("test"), 10);
You can reproduce / verify the problem on codesandbox.io.
I'm using a snackbar as a progress report, which for some fast commands should get closed a few milliseconds later.
| Tech | Version |
|--------------|--------------------------------|
| Notistack | v0.9.16 |
| React | v16.13.1 |
| Browser | Google Chrome (v81.0.4044.129) |
| Material-UI | v4.9.14 |
Thanks for reporting this @Gareon.
Fixed in https://github.com/iamhosseindhv/notistack/pull/280 and will be published as v0.9.17
@iamhosseindhv
Sorry to bother you, but until when can we expect the release? This fix would reduce a lot of work-arounds we had to introduce.
Thank you :)
Oops sorry @gareon I thought I'd published it 🤦🏻♂️
Thanks you for your patience. Fix is now published as 0.9.17
Most helpful comment
Oops sorry @gareon I thought I'd published it 🤦🏻♂️
Thanks you for your patience. Fix is now published as
0.9.17