adobe / adobe/react-spectrum

Adding a toast to ToastQueue replaces current visible toast

Open
#7,917 12 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
15.9k
Forks
1.6k
Avg merge
3d 9m
Merged PRs (30d)
59

Description

### Provide a general summary of the issue here

After upgrading to the March 5, 2025 Release, I am seeing a change in the behaviour of how the toasts are enqueued and displayed, which I think could be a bug.

I am using the `ToastQueue` with a `maxVisibleToasts` of 1 because I only want to display one toast at a time. Before upgrading, adding a toast to the queue would put it at the end of it (that is, unless given a higher priority). The visible toast would remain in place until dismissed or timed out.
After the upgrade, adding a toast to the queue immediately replaces any visible toasts with it, so it is not only put at the beginning of the queue but also replaces the visible toast. Once the latest toast is dismissed or timed out, the previous toast will be shown again.

In my opinion, removing the toast from the view can be quite confusing, especially when a few toasts are added in a short time, and the user cannot read (or hear) their contents. If this is a desired behaviour, I think it would be helpful to at least be able to configure it without rewriting the ToastQueue.

### 🤔 Expected Behavior?

Adding a toast to the queue does not replace the visible toast and puts it at the end of the queue.

### 😯 Current Behavior

Adding a toast to the queue replaces the visible toast.

### 💁 Possible Solution

_No response_

### 🔦 Context

_No response_

### 🖥️ Steps to Reproduce

https://codesandbox.io/p/sandbox/toastqueue-kh29s9

### Version

March 5, 2025 Release

### What browsers are you seeing the problem on?

Chrome

### If other, please specify.

_No response_

### What operating system are you using?

macOS

### 🧢 Your Company/Team

_No response_

### 🕷 Tracking Issue

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.