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
Drawer组件设置了getContainer并不总是起作用 #41951
Comments
Hello @baicoding. Please provide a online reproduction by forking codesandbox of antd@5.x or antd@4.x, or provide a minimal GitHub repository. Issues labeled by 你好 @baicoding, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击这里创建一个 antd@5.x 或 antd@4.x 的 codesandbox,或者提供一个最小化的 GitHub 仓库。3 天内未跟进此 issue 将会被自动关闭。 |
codesanbox链接 父容器
|
重现示例 |
那和 |
这个 |
因为 v4 到 v5 升级的时候 |
Reproduction link
Steps to reproduce
getContainer在使用时,对应的元素有什么要求,在实际使用时发现下面的问题:
1.getContainer={false},且style={{ position: "relative" }}时,能够正常挂载在对应的div中,
2.去掉style={{ position: "relative" }},会挂载到body中去
3.设置成getContainer={ref.current},将drawer放到上一级div中挂载时无法正常挂载在上一级div中,会挂载在body中,这个时候上一级的div同样设置position: "relative"也不启用,无法正确挂载到div中
What is expected?
能够根据getContainer的设置,正确挂载
What is actually happening?
在不同的情况下,挂载的结果不一样
The text was updated successfully, but these errors were encountered: