-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 Elements (Tooltip, Popover, Overlay) do not open with Portals #3248
Comments
Still not resolved, but we have found that by setting |
@mulholio i have never heard of this issue. my gut says it's something weird with your environment. can you please attempt to create a repro on codesandbox? https://codesandbox.io/s/rypm429574 |
Thanks for the link. I have tried copying problematic code from two different parts of our app and haven't succeeded in reproducing the bug in Codesandbox. Given this, I suspect your analysis is correct and our environment is doing something strange. Closing the issue, but was wondering if you had any ideas on what the cause might be? |
I have the exact same behaviour as you @mulholio Have you figured out what was wrong in your environment, and how to fix it? Regards |
@nikko242 no resolution yet. I'm just relying upon the |
Ok, thanks. No, we also use usePortal together with portalContainer to make it work. I have had a look at the code, and it seems strange to me that it could work on a different environment, it seems that portalContainer never gets set to "document.body" as default as stated in the documentation. |
@nikko242 Any luck on this? Was hoping to resolve the issue just with We've deleted all the CSS so it doesn't appear to be anything related to that. I can find the underlying Portal and children in React dev-tools but mousing over just shows 0px x 0px at the top left and doesn't actually render the content on the page. |
Further investigations:
Still trying to work out why the container prop is missing. |
We work around this, by manually settings portalContainer when Portal=true, it works .. but the code gets abit bloated:
|
I have taken a look in the blueprinjs source code, and I think It would be quite easy to fix: In "packages/core/src/components/overlay/overlay.tsx" |
Would the Blueprint team be open to adding this to the Overlay component? Before:
After: <Portal
className={this.props.portalClassName}
container={this.props.portalContainer ? this.props.portalContainer : document.body}
> At the very least, I feel like there should be some kind of error thrown if you try and create a portal with no container element referenced. As suggested by @nikko242 , Happy to make a PR. |
@mulholio that default gets set further down the component stack:
but I will admit it's confusing for Overlay's docs to list |
I'm also encountering this issue. Setting |
If you are still seeing this issue can you create a repro of it in a code sandbox (see link in the README or issue template) or a small repo? |
This is still an issue for me. Trying to see what I can do to simplify my own configuration and pinpoint the issue. Thus far, my best guess is that it somehow has something to do with Rails + Webpacker + Blueprint... I'm unable to get even a simple example (page literally just displays a Popover Button, all other JS/TS/CSS/SCSS code has been removed, and all unnecessary packages have been removed) to work with this pipeline using the latest versions of everything. Setting Any chance anyone else with this issue is using a similar setup? May try to see if I can create a fresh small repo with this, if for no other reason than to test my own sanity... |
Here's the smallest possible Rails + Webpack + Blueprint repo I could create. To my chagrin, still seeing the issue here. I've done the absolute minimum of additional configuration outside of the defaults. Would love to hear that the Rails defaults just misconfigure Babel or Webpack somehow... or that I did something super dumb and unexpected. Since Code Sandbox doesn't support this sort of environment, I can't replicate this there. I'm not able to reproduce my issue with Code Sandbox's pre-built envs. |
Hi, i've encountered same issue with my own setup. Usually, bundle injected in end of body, and div#root is present in layout. When I reverted setup to "defaults", problem is gone. Hope this would be helpful |
@chiubaka we were getting this issue on a Rails app too so sounds like you might be onto something. I've left the project recently but @strickland84 may have some relevant details. |
Ah... well, that's interesting. So actually including Moving |
Generally it's best practice to inject application scripts at the bottom of body anyway, so as to not block HTML rendering. |
I'm encountering this issue as well, but only when I'm using https://github.com/hotwired/turbo. Because of the way Turbo works, I put the script tags at the end of the head tag with the defer attribute. Given that people experiencing this issue seems to come from Rails, where Turbo originates from, it could make sense that the common denominator is the usage of Turbo. By investigating a bit more, I think I have more details:
I'm not sure what's the source cause but having |
There seems to be an issue with the opening of portals in certain environements. The problem only occurs in the production build; never in the development build. It may be related to the following (open) issue: palantir/blueprint#3248.
Environment
Steps to reproduce
<Popover />
anywhere withusePortal={true}
(default behaviour)Actual behavior
-
bp3-popover-open
class still appears on the targetusePortal
prop totrue
gets rid of the bug.Expected behaviour
Possible solution
Other Information
The text was updated successfully, but these errors were encountered: