Closed
Description
Basically I'm using a library, react-svg-pan-zoom, that places svg depending on the dynamic coordinates we give.
In this case, the v4 .rebuild() was to place the tooltip under the coordinates that it gave when hovering over the specific svg icon.
At the moment, with v5 the tooltip is updating the hover data but the tooltip box appears outside the svg icon and is always on screen, it doesn't just appear on the hover as before with v4.
Is there any way to trigger the tooltip like .rebuild() in v4?
v4:
const handleMouseOver = (e) => {
setData(...);
ReactTooltip.rebuild();
};
To insert Dynamic tooltip:
componentNode.setAttribute("data-tip", "");
componentNode.setAttribute("data-for", "tooltip");
React component:
<ReactTooltip
id="tooltip"
place="bottom"
type="light"
effect="solid"
backgroundColor="transparent"
getContent={() => {
return (
<Card
mainComponent={data?.mainComponent}
description={data?.description}
value={value}
machine={`${t("Machine")} ${id}`}
/>
);}}
/>
v5:
componentNode.setAttribute("data-content", "");
componentNode.setAttribute("data-for", "tooltip");
<ReactTooltip
id="tooltip"
place="bottom"
type="light"
effect="solid"
backgroundColor="transparent"
content={
<Card
mainComponent={data?.mainComponent}
description={data?.description}
value={value}
machine={`${t("Machine")} ${id}`}
/>
}
/>