Closed
Description
Bug description
I render the contents of the tooltip using the render prop of the Tooltip component
when quickly moving the cursor between two elements, situations arise when activeAnchor argument refers to one element and content argument contains data-tooltip-content from another element.
Version of Package
v5.25.0
To Reproduce
I used an example from here: https://github.com/ReactTooltip/react-tooltip/blob/master/docs/docs/examples/render.mdx
I only changed props of the Tooltip component:
<Tooltip
id="my-tooltip"
// delayShow={500}
// delayHide={20}
render={({ content, activeAnchor }) => {
console.log('activeAnchor', activeAnchor, 'content', content);
return (
<span>
{`The element #${content} is currently active.`}
<br />
Relevant attribute:
{activeAnchor?.getAttribute('data-some-relevant-attr') || 'not set'}
{content == 1 ? <><br />ddd</> : ''}
</span>
);
}}
/>
Expected behavior
the data-tooltip-content attribute of the activeAnchor prop should be the same as the content prop
Desktop (please complete the following information if possible or delete this section):
- OS: Windows 10 19045.3803
- Browser chrome
- Version 120.0.6099.110
- Frameworks React 18.2.0