Repository navigation
Description
Component
Toast
Package version
9.8.5
React version
19.3.1
Environment
System:
OS: Windows 11 10.0.26200
CPU: 11th Gen Intel(R) Core(TM) i5-1145G7 @ 2.60GHz
Memory: 15.7 GB
Binaries:
Node: 26.13.0
npm: 12.2.2
npmPackages:
@fluentui/react-components: 9.75.1 => 9.75.1
@fluentui/react-toast: 9.8.5 => 9.8.5
react: 19.3.1 => 19.3.1
react-dom: 19.3.1 => 19.3.1Current Behavior
Three cases where a toast that is queued behind the limit option is not handled by imperative dismissal. All three reproduce on master and none of them come from #36865.
-
dismissAllToastsgives queued toasts no status.queue.clear()drops them without callingonStatusChange, so a consumer tracking status never seesdismissedfor a toast that was never shown. This is also mentioned by Victor Genaev (@mainframev) on [Bug]: Inconsistent toast status #36862. -
A cleared queued toast id cannot be reused. The toast stays in the
toastsmap becauseremove()is only called fromuseToastContainer, which never runs for a toast that was never visible. A laterdispatchToastwith the sametoastIdreturns early atif (toasts.has(toastId))and nothing renders. -
dismissToaston a queued toast does nothing. The toast still becomes visible once a slot frees up.
Verified against @fluentui/react-toast@9.8.5 with the script in the reproduction link. Observed output:
CASE 1 dismissAllToasts on a queued toast
b queued (in map, not visible): true
status callbacks: ["a:null","b:null"]
b still in toasts map: true
b reported dismissed: false
CASE 2 reuse a cleared queued id
b in map before re-dispatch: true
b visible after re-dispatch: false
CASE 3 dismissToast on a queued toast
y visible before: false
y still in map after: true
y visible after: false
Expected Behavior
- A queued toast removed by
dismissAllToastsreportsdismissedthroughonStatusChange. - A queued toast removed from the queue is removed from the
toastsmap, so itstoastIdcan be dispatched again. dismissToastremoves a queued toast so it never becomes visible when a slot frees up.
On the duplicate warning above: this is distinct from #36862, which covers status for toasts that are visible and is addressed by #36865. Every case here involves a toast that was queued behind limit and never became visible, so #36865 does not change any of them. All three reproduce on master independently of that PR.
Reproduction
https://gist.github.com/jakesalvesen/fe3c8f26a9259942612262942bcf43f7
Steps to reproduce
- In an empty directory run
npm i @fluentui/react-toast@9.8.5 react@19 react-dom@19. - Save
repro.cjsfrom the gist and runnode repro.cjs. App.jsxshows the same three cases through the public API, usinguseToaster({ limit: 1 })anduseToastController.
The script creates a toaster with limit: 1, dispatches two toasts so the second one is queued, then dismisses imperatively and reads toasts.has(...) and isToastVisible(...).
Are you reporting an Accessibility issue?
no
Suggested severity
Medium - Has workaround
Products/sites affected
No response
Are you willing to submit a PR to fix?
yes
Validations
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- The provided reproduction is a minimal reproducible example of the bug.
Activity
tudorpopams commentedon Nov 11, 2026
Thanks for the detailed report and repro script! I confirmed on
masterthatdismissToastanddismissAllToastsdon't handle toasts still waiting in the queue, so I've routed this to the Toast owners. They'll review your PR #37126 alongside #36865, since both change the same dismissal code.cc @microsoft/cxe-prg
jakesalvesen commentedon Nov 12, 2026
Linking #37111, which covers these three cases in
@fluentui/react-toast. The PR currently linked to close this issue is #37115, which is the headless package, so #37111 may be the one that should close it. I have closed my #37126 in favor of #37111.