-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 position is incorrect if used within a Modal component #8468
Comments
Thank you for the report! #7992 looks similar and describes a problem where the floating link toolbar (popover/popup) sometimes appears in the wrong place. My default is to want to close all duplicates so we can consolidate issues and focus. @talldan do you think a fix for #7992 will cover the case outlined here in #8468 as well? |
@designsimply Sorry for the late response. I'm not sure, there's quite a lot going on in how popovers are positioned so I'd need a bit of time to debug the issue. I had a quick test by the way, and couldn't reproduce the issue above (granted I didn't use the exact code). I actually had a separate issue, that the dropdown menu appears behind the modal causing the options to be unclickable: |
The
A modal could be considered almost akin to a separate embedded document, in which case we might want to change where
There might be other options to explore for making this better supported. |
I am not sure if this is a design pattern that should be encouraged either, adding needs design feedback. |
I would second this really isn't something to encourage from a usability view. What is the use case being met here? |
What's the use case for using any kind of element that supports tooltips within a modal? I'm confused... are you saying that modals should not contain any kind of element that uses a tooltip? If the issue is specifically with my using the Regardless of what you put inside a modal window, last I checked, the tooltip for the modal close button itself does not position properly within the modal, and suffers the same problem of appearing far off to the right and below where it should appear. |
@tn3rb the root both @mtias and myself are trying to get to is whether we should encourage this design pattern. That comes down to even allowing it.
This sounds like the bug here to separate out. I agree tooltips should position correctly, however I also agree we should look at each element and see if something to encourage. Perhaps that is something for documentation right now. |
@karmatosed (or @mtias) can you please clarify what you mean by "this design pattern"? |
There has been improvements to the Popover component to make it more flexible and adapts to changes. Is this fixed now? |
The placement issues are resolved for me, but the I can see the thought process about this pattern potentially being abused, but since tooltips and standard https://cloudup.com/c6AC0KkW51k |
What needs to be done here? @youknowriad Riad @talldan Dan. Riad is focusing on the modal component lately here: #28574 and in another PR as well. |
I have just tested this using @Mamaduka code example above and this no longer appears to be an issue, see the screenshot below: Given this successful test, I am closing this issue. |
Describe the bug
First off, my apologies if this has already been reported. I was unable to find an existing issue that describes what I've found.
Any component that internally uses a
Popover
for displaying content such asTooltip
orDropdown
, does not position thePopover
correctly if used within aModal
component. I haven't explored the cause yet in any depth, but my initial thought is that it is due toPopover
usingwindow
to calculate positions instead of basing things off of the parent container.To Reproduce
Load the following code in the Post editor (
post.php
admin route) (plz note: it replaces#wpbody-content
):Or create your own
Modal
and add components that usePopover
Expected behavior
Popovers should position correctly when used within a
Modal
componentScreenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: