tooltips: Fix offscreen tooltips taking scroll space.

This commit is contained in:
Aman Agrawal 2023-05-23 21:39:42 +05:30 committed by Tim Abbott
parent 95f8b3a618
commit 54fae321aa
1 changed files with 16 additions and 0 deletions

View File

@ -87,4 +87,20 @@
text-align: center;
line-height: 14px;
}
/* If the reference of the tooltip is went offscreen while scrolling,
the tooltip will be visible until the scrolling stops. Popper adds
`data-reference-hidden` attribute to those tooltips whole reference is
hidden. Since tooltips have `absolute` position, they can occupy scroll
space offscreen and cause document to have the wrong scroll height.
Setting `display: none` makes sure it doesn't occupy any offscreen space.
NOTE: This data attribtute has changed each time in the past 3 releases and
if we upgrade tippy from v6, we should check if this attribute is still valid.
See https://github.com/atomiks/tippyjs/issues/555 for some discussion on this.
*/
[data-reference-hidden] {
display: none;
}
}