Skip to content

Commit

Permalink
fix: remove replaceChildren
Browse files Browse the repository at this point in the history
  • Loading branch information
万木 committed Jul 26, 2024
1 parent bff9543 commit 739c38d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
3 changes: 2 additions & 1 deletion src/ui/tooltip/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ export class Tooltip extends Component<TooltipStyleProps> {
const itemsElements = this.HTMLTooltipItemsElements;
const ul = document.createElement('ul');
ul.className = CLASS_NAME.LIST;
ul.replaceChildren(...itemsElements);
ul.innerHTML = '';
ul.append(...itemsElements);
const list = this.element.querySelector(`.${CLASS_NAME.LIST}`);
if (list) list.replaceWith(ul);
else container.appendChild(ul);
Expand Down

0 comments on commit 739c38d

Please sign in to comment.