From 3ea4b3b2b5f599dffdaed69cb6e650630019e926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torstein=20H=C3=B8nsi?= Date: Thu, 4 May 2023 13:03:56 +0200 Subject: [PATCH] Fixed #18927, shadow of split tooltip left artefacts in Safari --- ts/Core/Tooltip.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ts/Core/Tooltip.ts b/ts/Core/Tooltip.ts index 9eca162b982..229fde6d9d8 100644 --- a/ts/Core/Tooltip.ts +++ b/ts/Core/Tooltip.ts @@ -31,7 +31,7 @@ import type TooltipOptions from './TooltipOptions'; import F from './FormatUtilities.js'; const { format } = F; import H from './Globals.js'; -const { doc } = H; +const { doc, isSafari } = H; import { Palette } from './Color/Palettes.js'; import R from './Renderer/RendererUtilities.js'; const { distribute } = R; @@ -1573,6 +1573,18 @@ class Tooltip { container.style.left = boxExtremes.left + 'px'; container.style.top = chartTop + 'px'; } + + // Workaround for #18927, artefacts left by the shadows of split + // tooltips in Safari v16 (2023). Check again with later versions if we + // can remove this. + if (isSafari) { + tooltipLabel.attr({ + // Force a redraw of the whole group by chaning the opacity + // slightly + opacity: tooltipLabel.opacity === 1 ? 0.999 : 1 + }); + } + } /**