Hi Ton,
We have validated the
reported query in the shared sample. You can resolve your reported issue by
using `windowCollision`
property to enable or disable collision between target elements of Tooltip and
viewport. If this property is enabled, the tooltip will perform the collision
calculation between the target elements and viewport (window) instead of the Tooltip
element. Also, we have set proper height and width property to render Tooltip
in proper position.
Check the modified
code below.
|
<TooltipComponent
content={() => <span>Let's
go green to save the planet!!</span>}
position={this.state.position}
tabIndex={0}
width="220px"
height="30px"
style={{
display: 'block',
position: 'absolute',
left: 'calc( 50% - 60px)',
top: '45%',
}}
windowCollision={true}
target={`#source-mapping`}
>
|
Sample:
https://stackblitz.com/edit/react-9kkhrm-q4j5t4?file=index.js
Please check the shared
sample and get back to us if you need any further assistance.
Regards,
Indhumathy L