Using the tooltip attribute inside the Shadow Dom crashes Primereact on hover
Describe the bug
Probably a niche this bug, but so far everything Primereact works fine for me in the Shadow Dom.
Using the Tooltip component like so <Tooltip target=".custom-target-icon" /> does not work in the Shadow Dom and
<Button label="My Button" tooltip="My Tooltip"/> crashes Primereact like so:
Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'. which is a typical shadow dom error.
I did NOT include CSS in CodeSandbox. Is handled in the build process and that would mean a lot of work for me to get the CSS working in shadow dom in CodeSandbox
PS primereact Dialog works fine in the shadow dom (attachTo={shadowRoot})
Reproducer
https://4fxj97.csb.app/ https://codesandbox.io/s/4fxj97
PrimeReact version
9.2.0
React version
18.x
Language
ES6
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
Hover over the button to crahs Primereact
Expected behavior
Get the tooltip 'My Tooltip'
@mertsincan here is another Shadow DOM one is this the same issue? https://github.com/primefaces/primereact/issues/4096
Its not fixed, or well .. it does not crash anymore but it is rendered outside the ShadowDom
I updated CodeSandbox.
Thanks a lot for the update! For this case, you can use appendTo property of Tooltip.
I use appendTo property in my example. https://codesandbox.io/s/4fxj97 No style from within the shadow dom as you can see and attach a tooltip with a classname does not work at all.
Here exactly the same example but in the normal DOM https://codesandbox.io/s/y271pj Everything works as expected.
@mertsincan thank you for support. can you add a sample of Tooltip with appendTo property in shadow dom?
@kevinbuger looks like there are two new open Shadow DOM issues: https://github.com/primefaces/primereact/issues/5246
https://github.com/primefaces/primereact/issues/5240
I would subscribe to these.