react-tooltip icon indicating copy to clipboard operation
react-tooltip copied to clipboard

Wrong tooltip positioning after content text change on click

Open dominikkurbiel opened this issue 4 years ago • 3 comments

Hey, I have one small problem with tooltip positioning in case tooltip content has changed while tooltip is displayed.

It's working if instead of passing function to getContent prop, I pass array. But then this function is being called every second.

function renderContent() {
    return props.tooltipText;
}

return <ReactTooltip
    ...
    // Tooltip position is not updated after text change
    getContent=(renderContent)
    // Tooltip position is updated but its being called every second
    getContent={[renderContent, 1000]}
/>

You can try it live: https://codesandbox.io/s/react-tooltip-example-3116-forked-ydnr7

Any idea how to make it work without calling renderContent function in some interval?

image

dominikkurbiel avatar Oct 16 '20 15:10 dominikkurbiel

Any update on that?

zedomel avatar Nov 17 '20 19:11 zedomel

setting width on tooltip fixed it

farideliyev avatar Apr 18 '22 23:04 farideliyev

having more content in data-tip direction to tooltip gets changed on every time hover over. But working fine for the small content.

98rahul avatar May 18 '22 04:05 98rahul