英文:
How to override the transition of drawer from antd?
问题
我有 2 个 antd 抽屉 - 第一个调用第二个,当我打开第一个时一切都正常,但当我打开第二个时 - 第一个向右转移 180px - transformX(180px)。
我看到这是 GitHub 上的一个已知问题 - https://github.com/ant-design/ant-design/issues/18781,但我尝试了其中一个人写的解决方案,但没有奏效。
英文:
I have 2 drawers from antd - first calls the second, when I open the first everything is okay, but when I open the second - the first transitions 180px to the right
- transformX(180px)
I've seen that this is an open issue on github - https://github.com/ant-design/ant-design/issues/18781
but I've tried the solution one of them wrote and it didn't work.
答案1
得分: 3
通过 styled-components,有一种方法可以进行覆盖 -
import { Drawer } from "antd";
const StyledDrawer = styled(Drawer)``
.ant-drawer-content-wrapper {
transform: translateX(0px) !important;
}
```;
<details>
<summary>英文:</summary>
Through styled-components there's a way to override it -
import { Drawer } from "antd";
const StyledDrawer = styled(Drawer)
;
.ant-drawer-content-wrapper {
transform: translateX(0px) !important;
}
</details>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论