diff --git a/components/modal/nz-modal.component.ts b/components/modal/nz-modal.component.ts index 0275cdb30c3..9932040d713 100644 --- a/components/modal/nz-modal.component.ts +++ b/components/modal/nz-modal.component.ts @@ -49,6 +49,7 @@ import { ModalButtonOptions, ModalOptions, ModalType, OnClickCallback } from './ export const MODAL_ANIMATE_DURATION = 200; // Duration when perform animations (ms) type AnimationState = 'enter' | 'leave' | null; +export const WRAP_CLASS_NAME = 'ant-modal-wrap'; @Component({ selector: 'nz-modal', @@ -315,7 +316,7 @@ export class NzModalComponent extends NzModalRef if ( this.mask && this.maskClosable && - ($event.target as HTMLElement).classList.contains('ant-modal-wrap') && + ($event.target as HTMLElement).classList.contains(WRAP_CLASS_NAME) && this.nzVisible && !this.dialogMouseDown ) {