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/Tooltip breaks if parent is smaller(height) causing memory leak. #1482
Popover/Tooltip breaks if parent is smaller(height) causing memory leak. #1482
Comments
I will add to this - we're running into this problem as well. After updating to 8.0.0 one of our tooltips (specifically, one used on an AgGrid row) is causing the CPU to jump to 100% and lock up the browser. Reverting to pre-8 solves the problem (for anyone reading this, note that whatever dev-server you're running will probably need to be re-started as well). Increasing the height of the row, however, does not seem to solve the problem. |
Same problem here after update from 6.5.0 to 8.0.0. |
Getting this issue too when using |
Same thing here, does anyone have any pointers as to what specifically is causing this? Or to any possible workarounds? |
@YassienW I ended up rolling back to version 6.5.0. |
@YassienW #1488 (comment) try setting placement as suggested from the linked comment |
It does fix it since it stops the infinite render loop. I am not sure whether this is an issue with reactstrap or react-popper though. |
Considering #1488 (comment) fixes this issue, it seems that what happens is that |
A fix which doesn't require modifying <Popover placement="bottom"
modifiers={{ flip: { behavior: ['bottom'] } }}
// additional props
>
// children
</Popover>
|
My scenario was a little different (Edit: Not really), the popover was within a <Popover modifiers={{preventOverflow: {boundariesElement: "viewport"}}}> As per popper's documentation you can set this boundary to any DOM element as well, as long as the popper has enough space to render it shouldn't trigger the crash. Obviously this doesn't fix the root problem, but for anyone with the same scenario, this is the best fix yet. |
Another temporary fix is to disable the |
in my case (
|
This is a pretty nasty issue, anyone looked at or pointers on how we can PR in v8 aside from the workarounds? |
I avoid this by setting the Popover size explicitly, it's not a perfect solution but it does work in some cases when flipping is necessary and the popover size can be fixed.
|
…ining element When a tooltip or popover does not fit in the containing element, this causes the `PopperContent` component to get into an infinite loop of switching between `placement`s in its state. This is because we attempt to update `this.state.placement` everytime popper.js flips the placement to find a better fit and pass it back as the `placement` property to `ReactPopper`. This is a problem because the `PopperContent` component has two sources of truth for its placement. One coming from its own `placement` property, and one coming from the internal data of `ReactPopper`. This commit fixes the issue by using `PopperContent`'s `placement` property as the initial placement of the `ReactPopper` component and allowing `ReactPopper` to manage its own updates (i.e. if the popover needs to be flipped because there's not enough room for the specified placement.) Fixes reactstrap#1482 Fixes reactstrap#1488
When a tooltip or popover does not fit in the containing element, this causes the `PopperContent` component to get into an infinite loop of switching between `placement`s in its state. This is because we attempt to update `this.state.placement` everytime popper.js flips the placement to find a better fit and pass it back as the `placement` property to `ReactPopper`. This is a problem because the `PopperContent` component has two sources of truth for its placement. One coming from its own `placement` property, and one coming from the internal data of `ReactPopper`. This commit fixes the issue by using `PopperContent`'s `placement` property as the initial placement of the `ReactPopper` component and allowing `ReactPopper` to manage its own updates (i.e. if the popover needs to be flipped because there's not enough room for the specified placement.) Fixes #1482 Fixes #1488 Fixes #1664
Popover/Tooltip
8.0.0
Here is how you can replicate the issue.
Tooltip's works if you set placement.
This can also happens if the window size is smaller than the Popover/Tooltip.
codesanbox
The text was updated successfully, but these errors were encountered: