Skip to content

Commit

Permalink
fix tooltip-base.ts 返回值兼容 (#5360)
Browse files Browse the repository at this point in the history
Co-authored-by: shencc <123123>
  • Loading branch information
Shen120 authored Jan 22, 2024
1 parent 9ff0fd9 commit 038c7ed
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/pc/src/behavior/tooltip-base.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { modifyCSS, createDom } from '@antv/dom-util';
import { IG6GraphEvent } from '@antv/g6-core';
import { isString } from '@antv/util';

export default {
onMouseEnter(e: IG6GraphEvent) {
Expand Down Expand Up @@ -37,7 +38,11 @@ export default {
this.container = container;
}
const text = this.formatText(e.item.get('model'), e);
container.innerHTML = text;
if (isString(text)) {
container.innerHTML = text;
} else {
container.appendChild(text);
}
modifyCSS(this.container, { visibility: 'visible' });
this.updatePosition(e);
},
Expand Down

0 comments on commit 038c7ed

Please sign in to comment.