Search code examples
javascriptreactjsant-design-pro

Prevent Ant modal blocking background access


I'm using Ant modal in my react application, would appreciate if I can know the way to prevent modal popup disabling access to the background content. to remove the div tag it puts on top of the background.

regards


Solution

  • Disclamer: I haven't ever worked with that library.


    Any of its props doesn't seem to help but I did manage to hack it with CSS.

    Be aware that future library updates could break this hack.

    .ant-modal-mask {
      background: transparent;
      pointer-events: none;
    }
    .ant-modal-wrap {
      pointer-events: none;
    }
    .ant-modal {
      pointer-events: all;
    }