Tailwind: inside a shadowHost, CSSfrom the filter overlay in DataTable is purged
Describe the bug
I'm using Primereact in the sahdowHost. I'm experimenting now with Tailwind but stumbled upon the following issue.
When using Primereact with Tailwindcss inside a shadowHost, css from the filter overlay in DataTable in is purged by PurgeCSS I think.
Maybe all overlays have the same problem. I did not test those.
Reproducer
https://stackblitz.com/edit/vitejs-vite-nuemax?file=src%2Fmain.jsx
PrimeReact version
10
React version
18.x
Language
ALL
Build / Runtime
Vite
Browser(s)
all
Steps to reproduce the behavior
See stackblitz.
Click on the filter icon and you get tailwind class names inside the overlay but the CSS is purged I think
Expected behavior
Non puregd css so the filter overlay is styled
Definitely looks like an issue I assigned to PrimeTek and marked it as Tailwind issue. @bweis do you know if your fix will fix this issue as well?
@melloware Ai... I was wrong here. This issue has nothing to do with Tailwind or the purging of CSS. The issue is that the DataTable has not an 'appendTo' property as for instance the Dialog has. The filter dialog is appended to the normal document root and not to the shadow DOM, that's why it's not styled.
I chaged Stackblitz a bit, added the Dialog. If you remove the appendTo property from the Dialog it acts the same.
So it is more a request I guess to add an appendTo property for the filter overlay.
It might be a feature request this one.
I think you can do it globally https://primereact.org/configuration/#appendto
@melloware Wow missed the new confif option, nice!
Still have some issues though.
I guess I'll change the title
It's getting too far of the topic. I close this one and create a new issue
Getting too far off topic