fix: exclude sonner toast elements from sheet outside-click detection - #3805
Conversation
|
Warning Review limit reached
More reviews will be available in 4 minutes and 18 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Sheet component's outside-interaction suppression logic is expanded to recognize additional portal-like elements (Radix Popper content and Sonner toast elements) as portaled targets, preventing outside handlers from executing when interactions occur within these elements. ChangesSheet portal element detection
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Confidence Score: 5/5Safe to merge — the change is a two-line selector addition inside an existing exclusion list with no impact on other code paths. The change is narrowly scoped to adding two well-understood CSS attribute selectors that match Sonner's documented DOM attributes. It follows the same pattern already used for react-select and Radix poppers, and does not touch any logic outside the isPortaledElement helper. No files require special attention. Important Files Changed
Reviews (5): Last reviewed commit: "fix: prevent sheets closing on toast dis..." | Re-trigger Greptile |
0b58704 to
f7660f7
Compare
5a9d042 to
61c6161
Compare
f7660f7 to
0fc25a8
Compare
61c6161 to
fe5bb9f
Compare
0fc25a8 to
236bdfa
Compare
fa7e8a2 to
c620789
Compare
5c786d6 to
7652ab8
Compare
Merge activity
|
The base branch was changed.
…#3805) ## Summary Fixes an issue where clicking on Sonner toast notifications while a Sheet component is open would incorrectly trigger the sheet's outside-click detection, causing unintended sheet dismissal. ## Changes - Added `[data-sonner-toast]` and `[data-sonner-toaster]` to the list of portaled elements that the `SheetContent` outside-click handler ignores, preventing toasts from being treated as clicks outside the sheet. ## Type of change - [x] Bug fix - [ ] Feature - [ ] Refactor - [ ] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [x] UI (React) - [ ] Docs ## How to test 1. Open a Sheet component in the UI. 2. Trigger a Sonner toast notification while the sheet is open. 3. Click on the toast notification. 4. Verify the sheet remains open and is not dismissed by the toast click. ```sh cd ui pnpm i || npm i pnpm build || npm run build ``` ## Screenshots/Recordings N/A ## Breaking changes - [ ] Yes - [x] No ## Related issues N/A ## Security considerations None. ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [ ] I added/updated tests where appropriate - [ ] I updated documentation where needed - [ ] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable

Summary
Fixes an issue where clicking on Sonner toast notifications while a Sheet component is open would incorrectly trigger the sheet's outside-click detection, causing unintended sheet dismissal.
Changes
[data-sonner-toast]and[data-sonner-toaster]to the list of portaled elements that theSheetContentoutside-click handler ignores, preventing toasts from being treated as clicks outside the sheet.Type of change
Affected areas
How to test
Screenshots/Recordings
N/A
Breaking changes
Related issues
N/A
Security considerations
None.
Checklist
docs/contributing/README.mdand followed the guidelines