From 62ad220cff2e0fed09fd47f04c4ab9ac4e90c21e Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sun, 11 Jun 2023 19:53:01 +0930 Subject: [PATCH] fix(tooltip): only update tooltip content if original element content has changed --- src/tooltip/tooltip.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tooltip/tooltip.ts b/src/tooltip/tooltip.ts index c5cf03c..d61ae18 100644 --- a/src/tooltip/tooltip.ts +++ b/src/tooltip/tooltip.ts @@ -100,8 +100,8 @@ export default class TooltipElement extends HTMLElement { this.showing = true; } - if (tooltip.innerHTML !== this.innerHTML) { - tooltip.innerHTML = this.innerHTML; + if (this.innerHTML !== this.prevInnerHTML) { + this.prevInnerHTML = tooltip.innerHTML = this.innerHTML; } tooltip.style.position = 'absolute';