From 11fec80370fa7cd8e081acbd19e631a88cfff131 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sun, 24 Nov 2019 20:52:22 -0700 Subject: [PATCH] Hide tooltips with CSS when they aren't visible Fixes https://github.com/vector-im/riot-web/issues/11456 --- src/components/views/elements/Tooltip.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/views/elements/Tooltip.js b/src/components/views/elements/Tooltip.js index bb5f9f0604..8ff3ce9bdb 100644 --- a/src/components/views/elements/Tooltip.js +++ b/src/components/views/elements/Tooltip.js @@ -100,7 +100,9 @@ module.exports = createReactClass({ const parent = ReactDOM.findDOMNode(this).parentNode; let style = {}; style = this._updatePosition(style); - style.display = "block"; + // Hide the entire container when not visible. This prevents flashing of the tooltip + // if it is not meant to be visible on first mount. + style.display = this.props.visible ? "block" : "none"; const tooltipClasses = classNames("mx_Tooltip", this.props.tooltipClassName, { "mx_Tooltip_visible": this.props.visible,