fix: ensure toast notifications appear above modals#38870
fix: ensure toast notifications appear above modals#38870Naetiksoni08 wants to merge 2 commits intoRocketChat:developfrom
Conversation
🦋 Changeset detectedLatest commit: 4b88184 The changes in this PR will be included in the next version bump. This PR includes changesets to release 41 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
No actionable comments were generated in the recent review. 🎉 📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
WalkthroughAdds a new CSS rule Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Proposed changes
Toast notifications were appearing behind modals when triggered during team/channel creation. This was caused by #toastBarRoot (the toast portal container) having the same z-index as the modal, but appearing earlier in the DOM — causing the modal to visually stack above it.
before fix:
After Fix:
Added a CSS override in main.css to ensure #toastBarRoot always renders above the modal layer.
Issue(s)
Related to #38611
Steps to test or reproduce
Further comments
I also Investigated DOM reordering as an alternative approach, but both #modal-root and #toastBarRoot are created dynamically by their respective libraries on mount, making startup ordering unreliable. CSS z-index override on #toastBarRoot is the most reliable solution without modifying third-party library code.
Summary by CodeRabbit