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

[Bug] React Toast - Clear timer when Toast is hidden #1302

Open
kajabimark opened this issue Mar 30, 2022 · 0 comments
Open

[Bug] React Toast - Clear timer when Toast is hidden #1302

kajabimark opened this issue Mar 30, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@kajabimark
Copy link

Detailed description

Chrome 100.0.4896.60
When toggling visibility on a <Toast /> component, the 2nd time the component shows it's still using the same timer.

I was expecting the timer to reset each time the Toast is no longer active

Possible solution

Maybe just clear the setTimeout each time the Toast is dismissed

Steps to reproduce

Describe the steps to reproduce the behavior:

  1. Set the timeout prop on a Toast component to 6000
  2. Show, then hide the Toast
  3. Wait a few seconds
  4. Show the Toast again, and notice that it's only visible for whatever time remains from the initial 6 seconds

Screenshots

react-toast-timeout.mov
@kajabimark kajabimark added the bug Something isn't working label Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant