react-toastify icon indicating copy to clipboard operation
react-toastify copied to clipboard

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

Open anthonyraymond opened this issue 4 years ago • 2 comments

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?

anthonyraymond avatar Jun 14 '21 22:06 anthonyraymond

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

rus-yurchenko avatar Jun 21 '22 13:06 rus-yurchenko