fkhadra / react-toastify

React notification made easy 🚀 !
https://fkhadra.github.io/react-toastify/introduction
MIT License
12.74k stars 700 forks source link

Toast dismissal is slow #1148

Open bitofbreeze opened 2 months ago

bitofbreeze commented 2 months ago

What is the current behavior?

When a toast is dismissed, it visually goes off the screen but the next event is still blocked for some time after. For example, if you have a button that sends a toast with a hardcoded toastId (so multiple can't appear at the same time), and you click the button immediately after the first toast hides, it is blocked. It only works after a second or two after the first toast visually dismissed. I think it should work immediately once it's off screen, but I don't see any configuration for this.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your CodeSandbox (https://codesandbox.io/s/new) example below:

Click the button to show a toast, then immediately when it's gone off screen, try clicking the button again and notice the toast does not appear again. You must wait about a second before it will work again. https://stackblitz.com/edit/vitejs-vite-zspb8t?file=src%2FApp.tsx

What is the expected behavior?

I'd expect once the toast goes off screen, you can show another toast right away.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

Latest everything.

AwesomeIronman commented 1 month ago

Facing the same, I'm on toastify version 7.0.0 with react 17