Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses #9424 and maybe some others.
Old behavior
Tooltip always appears to the right of the "parent" element and is inserted after it into the DOM tree sharing the same parent. This results in two things:
New behavior
Tooltips are now parented to the
body
element, which results in them using as much horizontal space as possible (up to the limits set in bootstrap CSS for those):When there is little (<150 CSS pixels) space on the right side, the tooltip is shown above the "parent" element and if the page is scrolled down so that there isn't much space on top (<100 CSS pixels, fits 3 lines of text usually), it is drawn to the bottom of the "parent" element.
I had to resort to magic numbers in determining the direction as by the time placement function is called the exact size of the tooltip is undetermined.
The change is applied to all tooltips, so it addresses similar issues in other locations: blue checkmark tooltips on package details page and in search results, framework tooltips on package details page, etc.
getBoundingClientRect
support matrix: