mirror of
https://github.com/hiaaryan/sileo.git
synced 2026-04-26 23:45:50 +03:00
[PR #14] fix: toast hidden behind modals due to stacking context #23
Labels
No labels
bug
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/sileo#23
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hiaaryan/sileo/pull/14
Author: @ssantss
Created: 2/16/2026
Status: 🔄 Open
Base:
main← Head:fix/toast-z-index-portal📝 Commits (2)
956024cfix: render toast viewports via portal to prevent z-index issues with modals7f9c7e2fix: ensure toast viewports render only after component mounts📊 Changes
2 files changed (+52 additions, -46 deletions)
View changed files
📝
src/styles.css(+1 -1)📝
src/toast.tsx(+51 -45)📄 Description
Problem
Toasts render inline in the DOM tree wherever
<Toaster />is placed.When a modal or overlay with a higher z-index is open, toasts appear behind it
because of CSS stacking context limitations — no matter how high the z-index is.
Solution
createPortalfromreact-domto render toast viewports directly intodocument.bodymountedstate) to preventdocument.bodyaccess during server-side rendering (Next.js, Remix, etc.)50to9999(industry standard for notifications)This is the same approach used by sonner, react-hot-toast, and react-toastify.
Files changed
src/toast.tsx— portal + SSR guardsrc/styles.css— z-index 50 → 9999🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.