-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Reposition a popover while it is open #1438
Comments
This has to be opt-in - the issue is that otherwise for whatever reason we end up with minor jitter in the popover positioning even when the popover itself is static. |
@taion That makes sense. Would you see the setting as being a prop on the |
Exactly so. |
Closed by react-bootstrap/react-overlays#42. |
I am running in to a case where I am updating content inside a popover dynamically and the position of the popover ends up in the wrong place. I have put together a fiddle showing what I am experiencing.
https://jsfiddle.net/thetimbanks/L8yc6a3p/1/
I have dug through the code a little bit and it looks like the positioning of the popover is handled in the
updatePosition
method of thePosition
component. There are some checks to make sure to not try to reposition if theplacement
hasn't changed. In my case the placement hasn't changed, but the content has and therefor would need to be moved. Here is a proposed solution to theupdatePosition
method:This gets rid of the
placementChanged
check and always updates the position as long as there is a target. Is the cost of calculating the position and setting a new position that costly?I would be happy to throw together a PR for this if you would prefer to see it in action.
The text was updated successfully, but these errors were encountered: