mohsinulhaq/react-popper-tooltip

Version 4.X.X isn't supported in Shadow DOM.

shovalk opened this issue ยท 7 comments

Describe the bug
Version 4.X.X isn't supported in Shadow DOM.
The tooltip isn't working as expected. I've found 2 bugs:

  1. Tooltip trigger- a click on the trigger opens the tooltip, clicking on it again closes it and reopen it, the tooltip remain open.
  2. Tooltip element- clicking inside the tooltip doesn't execute the tooltip click behaviour, the tooltip just closes. Clicks inside the tooltip doesn't get fired.

To Reproduce
I've reproduced the issue by adding shadow DOM to the sandbox example you provided.
You can find it in this link-
https://codesandbox.io/s/flamboyant-sun-y2nbn?file=/src/index.js

Steps to reproduce the behavior:

  1. Use the new react popper tooltip version 4.x.x
  2. Wrap the tooltip with shadow Dom
  3. Click on the trigger to open the tooltip and then to close it -> the tooltip remains open.
  4. Click inside the tooltip -> the tooltips closes but the tooltip click behaviour isn't executed.

Expected behavior

  1. Clicking on the trigger should close the tooltip in case in was open.
  2. Clicking inside the tooltip should execute the tooltip click behaviour, it simply closes it.

@shovalk since you mentioned v4, does that mean it was working on v3?

nevermind, I just checked, it would have been the same in any version, since event.target doesn't work with shadow DOM.

@shovalk I have released v4.3.0-alpha.0 with the fix for the issue. Please check it out and let me know if it fixes all of your issues.

@mohsinulhaq Thank you. I'll try it and update you whether is works or not

Hey @mohsinulhaq I checked and it seems that the issue is resolved. Do you plan on releasing version 4.3.0?
Thanks!

@shovalk released v4.3.0

@mohsinulhaq Thank you