Search code examples
reactjsantdstyled-components

How to override the transition of drawer from antd?


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.


Solution

  • 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;
      }
    `;