Skip to content

Commit

Permalink
fix(tooltip): keep tooltip class updated
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyzerner committed Jan 10, 2024
1 parent d2800e7 commit cb19f93
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tooltip/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,6 @@ export default class TooltipElement extends HTMLElement {
private createTooltip() {
if (!this.tooltip) {
this.tooltip = document.createElement('div');
this.tooltip.className =
this.getAttribute('tooltip-class') ||
TooltipElement.tooltipClass;
this.tooltip.hidden = true;

this.tooltip.addEventListener('mouseenter', this.show.bind(this));
Expand All @@ -176,6 +173,9 @@ export default class TooltipElement extends HTMLElement {
document.body.appendChild(this.tooltip);
}

this.tooltip.className =
this.getAttribute('tooltip-class') || TooltipElement.tooltipClass;

return this.tooltip;
}
}

0 comments on commit cb19f93

Please sign in to comment.