From ecae1ae3abd503c3f023a3476b5dc5eb72a1d8d4 Mon Sep 17 00:00:00 2001 From: wisonic Date: Fri, 3 Jan 2025 17:57:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AF=E5=9B=BE=E8=A1=A8=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=B9=8B=E5=90=8E=E4=B8=8D=E4=BC=9A=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=B6=88=E5=A4=B1=20#13276=20#14337?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/js/panel/common/common_antv.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts b/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts index 589a12559e..7a892c5e32 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts @@ -1343,7 +1343,7 @@ export function configPlotTooltipEvent> plot.chart.getTheme().components.tooltip.y = event.clientY }) // https://github.com/antvis/G2/blob/master/src/chart/controller/tooltip.ts#hideTooltip - plot.on('plot:mouseleave', () => { + plot.on('plot:leave', () => { const tooltipCtl = plot.chart.getController('tooltip') if (!tooltipCtl) { return @@ -1355,6 +1355,22 @@ export function configPlotTooltipEvent> } tooltipCtl.hideTooltip() }) + // 移动端处理,关闭其他图表的提示 + plot.on('plot:touchstart', () => { + const wrapperDom = document.getElementById(G2_TOOLTIP_WRAPPER) + if (wrapperDom) { + const tooltipCtl = plot.chart.getController('tooltip') + if (!tooltipCtl) { + return + } + const container = tooltipCtl.tooltip.cfg.container + for (const ele of wrapperDom.children) { + if (container.id !== ele.id) { + ele.style.display = 'none' + } + } + } + }) } export const TOOLTIP_TPL =