fkhadra / react-toastify

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

[Feature request] Queued toast evict oldest one to make room #607

Open anthonyraymond opened 3 years ago

anthonyraymond commented 3 years ago

Hi,

Do you want to request a feature or report a bug? Request a feature

What is the current behavior? So far when there is a limit, if a toast is queued it will remains as such until a visible toast time out and finally vanish. At this point the queued toast will be shown.

What is the expected behavior? I'd like to have a gobal flag (at the ToastContainer level) to tell that if a toast enters the queue it must evict the oldest visible toast immediatly to make room.

Do you think this is something possible to do?

rus-yurchenko commented 2 years ago

I was going to request the same feature. As for me, it's a bit weird that with the limit set up we have to wait until all of the visible toasts are vanished before starting to add the toasts from the queue. This adds a noticeable gap from the user's perspective.

It'd be nice to configure the behavior to support something like a 'stack' when the newly added item shifts the oldest visible toast from the top of the stack.

Example:

https://user-images.githubusercontent.com/10502916/174815661-bf8e89cf-01c3-48b4-93ed-652d14763efc.mov

galangel commented 6 months ago

Very important to me as well