Skip to content

Commit

Permalink
[Fix] Add user defined overlayClassname (#1654)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdahle authored Oct 12, 2022
1 parent e2b3180 commit 4e77667
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion @navikt/core/react/src/modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -69,6 +73,7 @@ export const Modal = forwardRef<ReactModal, ModalProps>(
open,
onClose,
className,
overlayClassName,
shouldCloseOnOverlayClick = true,
closeButton = true,
"aria-describedby": ariaDescribedBy,
Expand Down Expand Up @@ -99,7 +104,7 @@ export const Modal = forwardRef<ReactModal, ModalProps>(
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={{
Expand Down

0 comments on commit 4e77667

Please sign in to comment.