-
-
Notifications
You must be signed in to change notification settings - Fork 700
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Popover API and top-layer support #959
Comments
I already had this in |
Just a gentle prompt that |
Currently, I am encountering this problem in a production project. I am looking for solutions and temporary workarounds until the library handles it on its own. |
Unfortunately there's no nice way to keep things in the topmost position. I imagine the whole toast container can be promoted to the top layer but everytime something new is promoted the toast container will need to be removed and re-promoted. |
I have tried to play around with this a bit and have something that, although not optimal, makes it appear above other popover or dialog. However, I still have a serious problem to solve that I will explain at the end. I will try to provide to you a example code ASAP, but by now i can explain it. I created a React wrapper component of the In the wrapper, I use the If the array of ids has content (there are toasts to show), I trigger Up to this point, it works wonderfully to appear above other "Solution": As @Link2Twenty indicated, reattaching the wrapper containing the For this, I have a function that does the But this function has to be executed every time a For popover, it's a simple (although not optimal) listener to the For the Well, after this suffering, everything looks fine. Every time I open another Not so fast, it looks good, but it does not work well. What happens when I want to close the toast? If the wrapper is an element with And in the same way, if the wrapper is a Therefore, I have reached a dead end where I see several drawbacks:
In my particular case, the components I use are fully developed by my team, so we can ban the use of It occurs to me that we could campaign, among all those interested, to reach the W3C and WHATWG with this problem, proposing several future changes to the standards to avoid this behavior and give the developer more control over these new top-layer elements! Changes like:
I apologize if I have made any mistakes in my assessments or if I have not considered any options or possibilities. If anyone has any ideas, please help! |
@lcoronelp I totally missed the inert issue 😕 I have already started a proposal to allow listening for top layer promotion and being able to change the render order of things in the top layer stack over on WHATWG. If you like you can raise your concern about inert over there too. |
Did you find a way to simulate a modal using popovers, especially making the background inert? I ask because we are running into the same limitation at Unsplash, so I'm considering a similar workaround to the one you describe. |
Do you want to request a feature or report a bug?
Feature request
What is the current behavior?
Toasts appear over the top of the base layer
What is the expected behavior?
Toasts should be elevated to the top layer where possible
With the new Popover API on the horizon it might be worth looking into allowing toasts to be placed in the top-layer. This will prevent toasts from being behind
dialog
s andpopover
elements which, I imagine, will become a problem in the future.Related issues
Feature Request: Top Layer Stack Management
API to get top layer elements
A popover on top of a modal dialog should be interactable
The text was updated successfully, but these errors were encountered: