How to hide the X button present at the top from the antd modal

13.2k views Asked by At

How to hide the X button present at the top from the ant d modal, also how can I disable the behavior of closing the modal using ESC key

return (
<Modal
title={modalHeader}
okText="EXIT"
cancelText="CONTINUE"
visible={visible}
onCancel={onCancelHandler}
onOk={exitUser}
width={600}
cancelButtonProps={{hidden:isExFlag}}
>
<DescriptionParagraph>
{modalBodyText}
</DescriptionParagraph>
</Modal>
);
1

There are 1 answers

0
Chanandrei On BEST ANSWER

Based on the documentation version 4.6.6

to hide the X button present at the top from the ant d modal, use the prop closable

<Modal closable={false}>...</Modal>

to disable the behavior of closing the modal using esc key, use the prop keyboard

<Modal keyboard={false}>...</Modal>

Edit prod-http-h73fi