Sonner 2.0.3: right-clicking a toast leaves interacting=true — all toasts stop auto-closing
Comments · 0
Be the first to comment.
Bug reportby SceneRecap AI
Repro steps
- 1.Open the Sonner demo page at /.
- 2.Click the 'Render a toast (bug)' button to show a toast.
- 3.Right-click the toast body in the bottom right corner.
- 4.Move the cursor away from the toast and wait.
- 5.Click 'Render a toast again' and 'Render a toast again 2' to create more toasts.
- 6.Keep the cursor away from the toasts and wait.
Expected
After the right click and once the cursor leaves the toast, the toast should close on its own. In the control run the toast rendered at 2.6s was gone by 7.0s. New toasts should also close on their own.
Actual
After the right click at 12.8s the toast stays visible with a darker border at 15.0s, 17.0s, 19.0s and 21.0s, even with the cursor away from it. Toasts created at 22.5s and 23.6s also never close. Three stacked toasts stay visible and expanded from 25.0s through 31.0s.
Evidence
Issue markdown (copy-paste ready)
## Summary After you right-click a toast, the toast stays in an active state. No toast closes on its own after that, including toasts created later. ## Environment - Chromium 151.0.7922.34, macOS - Viewport 1280x720, DPR 1, en-US, Europe/Berlin - Sonner demo site (`/`) - Version: Sonner 2.0.3. This comes from the report title and is not visible in the recording. ## Steps to reproduce 1. Open the Sonner demo page (0s). 2. Click **Render a toast (bug)** (10.5s). 3. Right-click the toast body (12.8s). 4. Move the cursor away from the toast and wait (15.0s). 5. Click **Render a toast again** (22.5s) and **Render a toast again 2** (23.6s). 6. Keep the cursor away from the toasts and wait (25.0s onward). ## Expected The toast closes on its own once the cursor leaves it. In the control run, the toast rendered at 2.6s closed by 7.0s. New toasts should also close on their own. ## Actual - The right-clicked toast stays visible with a darker border at 15.0s, 17.0s, 19.0s and 21.0s. The cursor is away from it. - Toasts created at 22.5s and 23.6s also never close. Three stacked toasts stay visible and expanded from 25.0s to 31.0s with no hover between 25.0s and 29.0s. ## Control The control run works correctly. It uses a left click on **Render a toast** at 2.6s. The toast is visible at 5.0s and gone by 7.0s. ## Evidence - 2.6s: control toast rendered. Overlay: 'CONTROL: toast auto-closes normally'. - 7.0s: control toast closed. This is correct. - 12.8s: right click on the toast body. - 15.0s: first frame where the toast should be closing. It is still visible with a darker border. - 25.0s to 31.0s: three toasts stuck and expanded. - No console or network data was captured. ## Suspected area The pointer handlers in Toaster/Toast that set the `interacting` flag. A right-button pointerdown likely sets `interacting=true`. The contextmenu then interrupts the normal pointerup, so the flag is never reset. That keeps the auto-close timers paused for the whole session. Possible fixes: ignore non-primary buttons, or reset the flag on contextmenu, pointerleave or pointercancel. *Recorded with SceneRecap.*
This report was written by SceneRecap from a screen recording. Try SceneRecap free
Turn a screen recording into a bug report like this one.
Repro steps, expected vs actual and the console and network evidence, each with a timestamp. On every plan, Free included.
Try SceneRecap free →