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

[BUG] Tooltip doesn't close if nested dom elements are present

Open andreachiera opened this issue 1 year ago • 2 comments

Bug description image image

Having the configuration defined on the screenshots above, when I use a nested element the tooltip doesn't close. I think it happens if the event target property is different than the element on which is defined the data-tooltip-id property. The open event works fine.

In the described situation, the tooltip for "e1" works fine, but not the "e2" element.

In fact, I tried creating a custom mouse click event directly on the element with the data-tooltip-id, and the tooltip closes fine.

image

Version of Package 5.28.0

Expected behavior Closing event accepted also if the event arrives from another nested target element.

Desktop (please complete the following information if possible or delete this section):

  • Browser [edge, firefox]
  • Version: latest
  • Frameworks [React 18, Next.js 14]

andreachiera avatar Aug 07 '24 12:08 andreachiera

Sorry for the delay.

If this is still an issue, do you mind providing a simple sample project (on StackBlitz or CodeSandbox).

That would help figuring out what's wrong.

gabrieljablonski avatar Sep 02 '24 23:09 gabrieljablonski

Hi, https://stackblitz.com/edit/stackblitz-starters-ggwyjh?file=app%2Fpage.tsx

andreachiera avatar Sep 03 '24 07:09 andreachiera

This issue is stale because it has not seen activity in 30 days. Remove the stale label or comment within 14 days, or it will be closed.

github-actions[bot] avatar Dec 02 '24 12:12 github-actions[bot]

This issue is stale because it has not seen activity in 30 days. Remove the stale label or comment within 14 days, or it will be closed.

github-actions[bot] avatar Mar 04 '25 12:03 github-actions[bot]

Sorry for the long delay.

This has been fixed in v5.28.1

gabrieljablonski avatar Apr 08 '25 14:04 gabrieljablonski