From 4e7766789c2300d01fbdf5a7012e7d2cbb407149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Harbo=20Dahle?= Date: Wed, 12 Oct 2022 16:06:03 +0200 Subject: [PATCH] [Fix] Add user defined overlayClassname (#1654) --- @navikt/core/react/src/modal/Modal.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/@navikt/core/react/src/modal/Modal.tsx b/@navikt/core/react/src/modal/Modal.tsx index e222ef22e4..19353ec185 100644 --- a/@navikt/core/react/src/modal/Modal.tsx +++ b/@navikt/core/react/src/modal/Modal.tsx @@ -27,6 +27,10 @@ export interface ModalProps { * User defined classname for modal */ className?: string; + /** + * User defined classname for modal + */ + overlayClassName?: string; /** * Removes close-button(X) when false * @default true @@ -69,6 +73,7 @@ export const Modal = forwardRef( open, onClose, className, + overlayClassName, shouldCloseOnOverlayClick = true, closeButton = true, "aria-describedby": ariaDescribedBy, @@ -99,7 +104,7 @@ export const Modal = forwardRef( isOpen={open} ref={mergedRef} className={cl("navds-modal", className)} - overlayClassName="navds-modal__overlay" + overlayClassName={cl("navds-modal__overlay", overlayClassName)} shouldCloseOnOverlayClick={shouldCloseOnOverlayClick} onRequestClose={(e) => onModalCloseRequest(e)} aria={{