Skip to content

Commit 58a5b79

Browse files
fix: use content from activeAnchor on render()
1 parent 758df51 commit 58a5b79

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/TooltipController/TooltipController.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,9 @@ const TooltipController = React.forwardRef<TooltipRefProps, ITooltipController>(
309309
let renderedContent: ChildrenType = children
310310
const contentWrapperRef = useRef<HTMLDivElement>(null)
311311
if (render) {
312-
const rendered = render({ content: tooltipContent ?? null, activeAnchor }) as React.ReactNode
312+
const actualContent =
313+
activeAnchor?.getAttribute('data-tooltip-content') || tooltipContent || null
314+
const rendered = render({ content: actualContent, activeAnchor }) as React.ReactNode
313315
renderedContent = rendered ? (
314316
<div ref={contentWrapperRef} className="react-tooltip-content-wrapper">
315317
{rendered}

0 commit comments

Comments
 (0)