-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
react 节点下 foreignObject 可以不使用body标签名? #4100
Comments
Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. |
可以使用 子元素选择器 > , 限定是html子元素的那个body(html > body) https://developer.mozilla.org/zh-CN/docs/Web/CSS/Child_combinator |
我知道这样可以 很多库里面写了$('body'),layui就有 |
一个一个改很麻烦 而且不好升级 |
https://github.com/antvis/X6/blob/master/packages/x6-vue-shape/src/node.ts#L26 可以试试不传primer参数,或者传一个null进去,应该就没有body元素了 |
为什么这里可以在foreignObject下使用body标签而没有警告,我在项目下使用的其他组件被这个错误的body误导出现错误行为,我尝试在自己的组件下新建一个body屏蔽这个行为,但是 React 给我警告: |
看源码 使用的是createElementNS, 带命名空间的创建可能不一样,我试了下这样确实不报错,但是不知道为什么会创建两个 foreignObject 出来
|
我也遇到这个问题了,请问解决了吗 |
Describe the bug
在一些JQ项目和库里,会导致JQuery("body")选择多个节点,dom操作的时候会都触发
Your Example Website or App
https://stackoverflow.com/help/mcve.
Steps to Reproduce the Bug or Issue
渲染antv/x6 react元素
")JQuery("body").append("
Expected behavior
JQuery("body").append("
")只在document.body下Screenshots or Videos
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: