[toast] Prevent duplicate onClose calls for ending toasts#4280
[toast] Prevent duplicate onClose calls for ending toasts#4280atomiks merged 3 commits intomui:masterfrom
onClose calls for ending toasts#4280Conversation
commit: |
Bundle size report
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codex ReviewOverviewThis patch now updates toast state before running Findings (None)No blocking issues found in this patch. Confidence: 5/5High confidence based on the full branch diff, the narrow implementation surface, and focused verification of the shared toast-manager code path. Notes
|
| } | ||
| }); | ||
|
|
||
| this.handleFocusManagement(toastId); |
There was a problem hiding this comment.
This function is the only one with a side effect, so I moved it below to keep the order unchanged.
The execution order remains onClose → focus update (onFocus / onBlur).
Although this depends on the state internally, it only looks up the next (or prev) active toast, so I believe changing the position should not cause any issues.
This PR fixes an issue where
onClosecould be triggered multiple times when a toast is already in the ending state as pointed out here.