ant-design / cssinjs

https://ant-design.github.io/cssinjs
MIT License
235 stars 57 forks source link

prependQueue style 样式丢失 #119

Open yaxiaoliu opened 1 year ago

yaxiaoliu commented 1 year ago

我的 chrome 插件(用的 plasmo 框架)有两个 shadowDom 的 content_script 注入,其中随机的出现部分 antd 样式丢失,比如 ant-tooltip

image

发现所在的 shadowRoot 中相关的 style 标签为空了

image

而同一个页面另外个 shadowRoot 正常:

image

对应的 style 标签内容正常:

image

两个 shadowRoot 的 StyleProvider 写法也没区别:

<StyleProvider container={document.getElementById(SEARCH_ENHANCE_ID).shadowRoot}>
和
<StyleProvider container={document.getElementById(HOST_ID).shadowRoot}>

依赖版本: "@ant-design/cssinjs": "^1.10.1", "antd": "^5.6.3",

WE1ZHANTA0 commented 11 months ago

我也出现了这个问题,部分组件的样式丢失,请问你解决了吗

mb8z commented 10 months ago

Having the same issue. Works fine for most element, but e.g. ant-message components are getting injected into the head, instead of the shadowRoot passed to the container

infodusha commented 7 months ago

I have the same issue with Tag component

afc163 commented 7 months ago

Trace https://github.com/ant-design/ant-design/issues/45894

cc @zombieJ

GisonL commented 4 months ago

我也是在开发Chrome插件时使用shadowDom,其他组件能正确插入到指定节点,只有message的样式被插入到了body-head中