Skip to content
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

PopperContent memory leak #1669

Merged
merged 1 commit into from Oct 18, 2019
Merged

Commits on Oct 17, 2019

  1. fix(PopperContent): fix memory leak when popover doesn't fit in conta…

    …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
    phwebi committed Oct 17, 2019
    Copy the full SHA
    cb7aead View commit details
    Browse the repository at this point in the history