From 58a5b79c371c11ac4d621a60434fa2b38d34945f Mon Sep 17 00:00:00 2001 From: gabrieljablonski Date: Sat, 10 Feb 2024 16:16:24 -0300 Subject: [PATCH] fix: use content from `activeAnchor` on `render()` --- src/components/TooltipController/TooltipController.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/TooltipController/TooltipController.tsx b/src/components/TooltipController/TooltipController.tsx index 17463631..f22e4c64 100644 --- a/src/components/TooltipController/TooltipController.tsx +++ b/src/components/TooltipController/TooltipController.tsx @@ -309,7 +309,9 @@ const TooltipController = React.forwardRef( let renderedContent: ChildrenType = children const contentWrapperRef = useRef(null) if (render) { - const rendered = render({ content: tooltipContent ?? null, activeAnchor }) as React.ReactNode + const actualContent = + activeAnchor?.getAttribute('data-tooltip-content') || tooltipContent || null + const rendered = render({ content: actualContent, activeAnchor }) as React.ReactNode renderedContent = rendered ? (
{rendered}