diff --git a/jest.config.js b/jest.config.js index e2e5aaf75..dc464dd3b 100644 --- a/jest.config.js +++ b/jest.config.js @@ -16,7 +16,7 @@ module.exports = { sourceMap: true, }, }, - ], + ], }, moduleFileExtensions: ['ts', 'tsx', 'js', 'json'], testRegex: '/__tests__/.*(-|\\.)spec\\.ts?$', diff --git a/package.json b/package.json index 7fbe9e26c..98a9d0ea6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@antv/component", - "version": "2.0.1", + "version": "2.0.2", "description": "Visualization components for AntV, based on G.", "license": "MIT", "main": "lib/index.js", diff --git a/src/ui/tooltip/index.ts b/src/ui/tooltip/index.ts index 8bb1b273b..ce0e58507 100644 --- a/src/ui/tooltip/index.ts +++ b/src/ui/tooltip/index.ts @@ -151,7 +151,11 @@ export class Tooltip extends Component { const itemsElements = this.HTMLTooltipItemsElements; const ul = document.createElement('ul'); ul.className = CLASS_NAME.LIST; - ul.replaceChildren(...itemsElements); + if (ul.replaceChildren) ul.replaceChildren(...itemsElements); + else { + ul.innerHTML = ''; + ul.append(...itemsElements); + } const list = this.element.querySelector(`.${CLASS_NAME.LIST}`); if (list) list.replaceWith(ul); else container.appendChild(ul);