Skip to content

Commit 1468f78

Browse files
authored
fix: Fix CSS classes reassignment when content is updated (#16)
1 parent d38be0f commit 1468f78

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Tooltip.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ class Tooltip {
115115
this.#createTooltip()
116116
}
117117

118-
if (hasContainerClassNameChanged) {
118+
if (hasContainerClassNameChanged || hasContentChanged) {
119119
this.#tooltip.classList.add(this.#containerClassName || '__tooltip')
120120
}
121121

122-
if (hasPositionChanged) {
122+
if (hasPositionChanged || hasContainerClassNameChanged || hasContentChanged) {
123123
this.#tooltip.classList.remove(`__tooltip-${oldPosition}`)
124124
this.#tooltip.classList.add(`__tooltip-${this.#position}`)
125125
}

0 commit comments

Comments
 (0)