Search code examples
reactjsantd

Why ant design Drawer not showing close icon?


This piece of code not showing any close icon in the ant design Drawer.

<Drawer
        title="Job ID: 9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"
        placement="right"
        closable={false}
        onClose={onJobDetailsDrawerClose}
        visible={jobDetailsDrawervisible}
        width="75%"
        closeIcon={<CloseOutlined />}
      >

But the drawer API showed this:

API reference from ant design

Any idea why the Drawer not showing up any close icon?


Solution

  • Appears the close icon is hidden when you specify

    closable={false}
    

    Drawer API - closable

    Whether a close (x) button is visible on top right of the Drawer dialog or not.

    enter image description here

    With this prop set to false the drawer is toggleable externally.