You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by wa...@apache.org on 2020/10/08 05:18:29 UTC

[incubator-echarts] branch fix/tooltip updated: fix(tooltip): still use concat html string for arrow.

This is an automated email from the ASF dual-hosted git repository.

wangzx pushed a commit to branch fix/tooltip
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git


The following commit(s) were added to refs/heads/fix/tooltip by this push:
     new d4c873a  fix(tooltip): still use concat html string for arrow.
d4c873a is described below

commit d4c873a7ce7eff7abbf27a16745c2550dc53a851
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Thu Oct 8 13:17:57 2020 +0800

    fix(tooltip): still use concat html string for arrow.
---
 src/component/tooltip/TooltipHTMLContent.ts | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/component/tooltip/TooltipHTMLContent.ts b/src/component/tooltip/TooltipHTMLContent.ts
index bc44046..aaa9353 100644
--- a/src/component/tooltip/TooltipHTMLContent.ts
+++ b/src/component/tooltip/TooltipHTMLContent.ts
@@ -83,7 +83,7 @@ function assembleArrow(
         `background-color: ${backgroundColor};`,
         'box-shadow: 8px 8px 16px -3px #000;'
     ];
-    return styleCss.join('');
+    return `<div style="${styleCss.join('')}"></div>`;
 }
 
 function assembleTransition(duration: number): string {
@@ -353,16 +353,13 @@ class TooltipHTMLContent {
         if (content == null) {
             return;
         }
-        this.el.innerHTML = content;
 
         if (isString(arrowPosition) && tooltipModel.get('trigger') === 'item'
             && !shouldTooltipConfine(tooltipModel)) {
-
-            const arrow = document.createElement('div');
-            arrow.style.cssText = assembleArrow(tooltipModel.get('backgroundColor'), borderColor, arrowPosition);
-
-            this.el.appendChild(arrow);
+            content += assembleArrow(tooltipModel.get('backgroundColor'), borderColor, arrowPosition);
         }
+
+        this.el.innerHTML = content;
     }
 
     setEnterable(enterable: boolean) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org