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

Tooltip crash the current open tab in the browser when the space is not availaible for the tooltip; #1664

Closed
Aashishgtbit opened this issue Oct 15, 2019 · 1 comment · Fixed by #1669

Comments

@Aashishgtbit
Copy link

  • components: Tooltip
  • reactstrap version #8.0.1
  • import method umd/csj/es
  • react version #16.9.0
  • bootstrap version #4.x

What is happening?

When I use the tool tip in my web app if the browser has not enough space for the tooltip then it will crash the current open tab . For example I have a side bar which has some data rows and I want to use tooltip for each item and position it right , It is working perfectly fine for the top position .

What should be happening?

it should adjust its position automatically when enough space is not available .

Steps to reproduce issue

  1. ...
  2. ...

Error message in console

paste error message with stacktrack here

Code

@nylon22
Copy link
Contributor

nylon22 commented Oct 17, 2019

Looks like duplicate of #1488 and #1482

@phwebi phwebi mentioned this issue Oct 17, 2019
12 tasks
TheSharpieOne pushed a commit that referenced this issue Oct 18, 2019
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants