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

closeSnackbar does not work shortly after enqueuing it #277

Closed
Gareon opened this issue May 20, 2020 · 3 comments
Closed

closeSnackbar does not work shortly after enqueuing it #277

Gareon opened this issue May 20, 2020 · 3 comments

Comments

@Gareon
Copy link

Gareon commented May 20, 2020

Expected Behavior

When calling closeSnackbar shortly after enqueuing, it should get closed.

Current Behavior

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.

Steps to Reproduce

  1. 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);
  2. Behold the persisting snackbar, which actually should get closed.

You can reproduce / verify the problem on codesandbox.io.

Context

I'm using a snackbar as a progress report, which for some fast commands should get closed a few milliseconds later.

Your Environment

Tech Version
Notistack v0.9.16
React v16.13.1
Browser Google Chrome (v81.0.4044.129)
Material-UI v4.9.14
@Gareon Gareon changed the title closeSnackbar does not work after enqueuing it closeSnackbar does not work shortly after enqueuing it May 20, 2020
@iamhosseindhv
Copy link
Owner

Thanks for reporting this @Gareon.
Fixed in #280 and will be published as v0.9.17

@Gareon
Copy link
Author

Gareon commented Jun 10, 2020

@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 :)

@iamhosseindhv
Copy link
Owner

iamhosseindhv commented Jun 10, 2020

Oops sorry @Gareon I thought I'd published it 🤦🏻‍♂️
Thanks you for your patience. Fix is now published as 0.9.17

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

No branches or pull requests

2 participants