Skip to content

Commit 74eaa69

Browse files
gabrieljablonskiGabriel Jablonski
authored andcommitted
fix: interaction between content and html
1 parent 82c66d1 commit 74eaa69

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/TooltipController/TooltipController.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,10 @@ const TooltipController = ({
6868
setTooltipPlace((value as PlacesType) ?? place)
6969
},
7070
content: (value) => {
71-
setIsHtmlContent(false)
7271
setTooltipContent(value ?? content)
7372
},
7473
html: (value) => {
75-
setIsHtmlContent(!!value)
74+
setIsHtmlContent(Boolean(value ?? html))
7675
setTooltipContent(value ?? html ?? content)
7776
},
7877
variant: (value) => {
@@ -111,9 +110,12 @@ const TooltipController = ({
111110

112111
useEffect(() => {
113112
if (content) {
113+
setIsHtmlContent(false)
114114
setTooltipContent(content)
115115
}
116116
if (html) {
117+
// html will always take precedence
118+
setIsHtmlContent(true)
117119
setTooltipContent(html)
118120
}
119121
}, [content, html])

0 commit comments

Comments
 (0)