how to mount a modal inside a drawer ant design

1.7k views Asked by At

I am facing an issue passing in the proper node element to the getContainer property. I'd like to display a Modal.confirm within a drawer.

I've tried using:

Modal.confirm({
    mask: false,
    title: 'Confirm',
    content: 'Bla bla ...',
    okText: 'test',
    cancelText: 'test',
    getContainer: () => document.getElementsByClassName('ant-drawer-body'),
  })

Nothing appears when the drawer is opened and no errors are displayed in console.

https://www.antdv.com/components/drawer/ https://www.antdv.com/components/modal/

Also tried with:

getContainer: () => document.getElementsByClassName('ant-drawer-content')[0]

and it appears that the modal opens in the center of the drawer at first when the drawer opens, but immediately centers to the page after.

0

There are 0 answers