fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

TooltipHost position is wrong when wrapped component uses absolute position

Open yajiex opened this issue 7 years ago • 6 comments

Here is the repro link: https://codepen.io/anon/pen/QojjBd. There is a button and wrapped with TooltipHost, the button's position is absolute. When hovering on the button, the tooltip shows at wrong position.

Environment Information

  • Package version(s): latest version (not specified)
  • Browser and OS versions: any browser

Please provide a reproduction of the bug in a codepen:

https://codepen.io/anon/pen/QojjBd

Actual behavior:

Tooltip's position is wrong.

Expected behavior:

Tooltip should be near the button.

Priorities and help requested:

Requested priority: Blocking

yajiex avatar Feb 28 '19 05:02 yajiex

Hi @yajiex, thanks for submitting this issue. After digging around on the component and getting some assistance from @joschect on this, you can fix this issue by adding an id to the button (or whatever you're positioning absolute), and then adding that ID as a target in the calloutProps of TooltipHost.

See codepen here:

https://codepen.io/leddie24/pen/NJxWJN

leddie24 avatar Feb 28 '19 21:02 leddie24

Thanks, the workaround looks good to me. Do you think it's a bug or by design?

yajiex avatar Mar 01 '19 07:03 yajiex

This issue has been marked as being beyond the support scope of UI Fabric's issues board. It will now be closed automatically for house-keeping purposes.

msft-github-bot avatar Mar 02 '19 08:03 msft-github-bot

Hey @yajiex , sorry for the bot closing this issue prematurely. This is definitely not by design (to have the tooltip not fix properly on absolute positioned elements), and seems more like a bug. However, with the workaround in place, I don't think it's something worth pursuing to fix when there are easy fixes. We can update the documentation in the future to showcase this scenario.

leddie24 avatar Mar 04 '19 20:03 leddie24

Thanks, updating the doc sounds good!

yajiex avatar Mar 05 '19 00:03 yajiex

:tada:This issue was addressed in #8196, which has now been successfully released as [email protected].:tada:

Handy links:

msft-github-bot avatar Mar 06 '19 13:03 msft-github-bot