Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

fix(position): for SVG elements #1225

Closed

Conversation

musically-ut
Copy link
Contributor

Bootstrap tooltips calculate the width and height of elements
using first getBoundingClientRect and fall back to offsetWidth and
offsetHeight if it is not available:

https://github.com/twbs/bootstrap/blob/master/js/tooltip.js#L297

This fixes a problem with tooltips/popovers on SVG elements in
Firefox: twbs/bootstrap#5956

This change mimics that behavior.

I have also added a test case for the scenario.

Buggy behaviour:

bug

Fixed behaviour:

fix

Bootstrap tooltips calculate the `width` and `height` of elements
using first getBoundingClientRect and fall back to `offsetWidth` and
`offsetHeight` if it is not available:

https://github.com/twbs/bootstrap/blob/master/js/tooltip.js#L297

This fixes a problem with tooltips/popovers on SVG elements in
Firefox: twbs/bootstrap#5956

This change mimics that behavior.
@pkozlowski-opensource
Copy link
Member

Totally awesome pull request @musically-ut , you rock! If only half of PRs would be of this quality, GitHub would be a better place.

Going to merge it later today.

@musically-ut
Copy link
Contributor Author

Thanks for the warm fuzzy feeling. :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants