apache / apache/echarts

[Bug] TypeError: null is not an object (evaluating 'this.el.style') in TooltipHTMLContent.js

Open
#20,943 6 comments 0 reactions 0 assignees View on GitHub
bug cannot-reproduce en missing-demo pending waiting-for: author
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### Version

5.5.1

### Link to Minimal Reproduction

https://codesandbox.io/p/sandbox/echarts-basic-example-template-mpfz1s?file=%2Fsrc%2Findex.js

### Steps to Reproduce

1. The project is built using vue3, vite, and Typescript
2. The configuration of echart is
```js
const dashboardOption: Ref = ref({
backgroundColor: '#fff',
tooltip: {
trigger: 'axis',
backgroundColor: '#fff',
enterable: true,
padding: [0],
appendTo: 'body',
hideDelay: 0,
borderColor: 'rgba(0, 0, 0, 0.20)',
borderRadius: 6,
borderWidth: 1,
borderStyle: 'solid',
boxShadow: '0px 8px 24px 0px rgba(0, 0, 0, 0.16)',
formatter: (params: any) => {
return "

${timeMode.value}
";
},
},
grid: {
left: 72,
right: 8,
bottom: 36,
top: 5,
},
xAxis: [],
yAxis: [],
series: [],
});
```

3 .It occasionally appears when the mouse moves into the chart
4. browserInfo":"browser: Apple Safari, version: 16.1

### Current Behavior

Use style directly

```js
TooltipHTMLContent.prototype.hide = function () {
var _this = this;
var style = this.el.style; // The error comes from here
style.visibility = 'hidden';
style.opacity = '0';
env.transform3dSupported && (style.willChange = '');
this._show = false;
this._longHideTimeout = setTimeout(function () {
return _this._longHide = true;
}, 500);
};
```

### Expected Behavior

Use after judging empty

### Environment

```markdown
- OS: macOS
- Browser:safari 16.6
- Framework:Vue@3 Typescript vite
```

### Any additional comments?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.