Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

tooltips: Fix offscreen tooltips taking scroll space.

Aman Agrawal54fae321aadb
diff --git a/web/styles/tooltips.css b/web/styles/tooltips.css
index 21b8bd22d11..fd2b92d972d 100644
--- a/web/styles/tooltips.css
+++ b/web/styles/tooltips.css
@@ -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;
+ }
}