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 causes the browser to crash if window size is changed #1488
Comments
I cannot reproduce. Does this happen for you on https://reactstrap.github.io/components/popovers/ ? |
You have to resize the window quickly so that part of the popover is out of the window view. The browser crashes right after that. If you open the Chrome Devtools while the popover is open, you'll get the same issue. This issue may be related to this one #1482 |
Open your samples in minimal browser size and click on any popover - it will reproduce. |
The same happens with tooltips |
As a hotfix changed |
My browser crashes as well while using tooltips.Its a bit tricky to reproduce but as far as i know it often happens when mouse moves to quickly over the tooltip hover element or mouse hovers over a tooltip element during/after scrolling. I am using uncontrolled tooltips with delays mentioned below.
Edit: Nevermind, this is related to #1482 |
For me it happens if the tooltip does not fit in the window. As long as the tooltip fits on the page it works fine but if I keep decreasing the window size it fails. Edit: Nevermind, this is related to #1482 |
@usman-subhani Would this fix your issue? #1482 (comment) |
@YassienW Yes downgrading to v7.1.0 of reactstrap resolved this for me. Thanks 👍 Also setting the tooltip prop |
This issue also happens if the popover is bigger than the current viewport on opening the popover |
…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
8.0.0
Steps to reproduce the issue
The text was updated successfully, but these errors were encountered: