Commit 0d7ece8
authored
fix(code): make toast close button clickable (#2145)
## Summary
- The X (close) button on toasts was unresponsive — clicking it did nothing.
- Root cause: sonner's pointerdown handler on the toast `<li>` only short-circuits when `event.target.tagName === 'BUTTON'`. Clicking the X made the SVG icon the event target, so sonner called `setPointerCapture` on the SVG and engaged its swipe logic, swallowing the click before the IconButton's `onClick` could fire `sonnerToast.dismiss(id)`.
- Fix: add `pointer-events-none` to the `<XIcon>` so the click target is always the button itself, which hits sonner's BUTTON early-return.
- Applies to every toast type (success / error / info / warning), not just "You're on the latest version" — that one was just easy to reproduce because it's a sticky non-loading toast.
## Test plan
- [ ] Trigger "You're on the latest version" toast (Check for updates → already up to date) and click the X — toast dismisses.
- [ ] Trigger any error/success/info/warning toast and click the X — toast dismisses.
- [ ] Toasts with an action label still dismiss when the action is clicked.1 parent 57a6677 commit 0d7ece8
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
0 commit comments