Skip to content

Commit

Permalink
feat: allow consumers to configure ModalDialog to allow overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-smith-tcril committed Jan 3, 2024
1 parent 6927788 commit 6b611a0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Modal/ModalDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function ModalDialog({
isFullscreenOnMobile,
isBlocking,
zIndex,
isOverflowVisible,
}) {
const isMobile = useMediaQuery({ query: '(max-width: 767.98px)' });
const showFullScreen = (isFullscreenOnMobile && isMobile);
Expand All @@ -44,6 +45,7 @@ function ModalDialog({
[`pgn__modal-${showFullScreen ? 'fullscreen' : size}`]: size,
[`pgn__modal-${variant}`]: variant,
'pgn__modal-scroll-fullscreen': isFullscreenScroll,
'pgn__modal-visible-overflow': isOverflowVisible,
},
className,
)}
Expand Down Expand Up @@ -120,6 +122,8 @@ ModalDialog.propTypes = {
* Specifies the z-index of the modal
*/
zIndex: PropTypes.number,
/** Specifies whether overflow is visible in the modal */
isOverflowVisible: PropTypes.bool,
};

ModalDialog.defaultProps = {
Expand All @@ -133,6 +137,7 @@ ModalDialog.defaultProps = {
isFullscreenOnMobile: false,
isBlocking: false,
zIndex: undefined,
isOverflowVisible: false,
};

ModalDialog.Header = ModalDialogHeader;
Expand Down
8 changes: 8 additions & 0 deletions src/Modal/_ModalDialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@
top: calc(#{$modal-inner-padding} / 2 * -1);
}
}

&.pgn__modal-visible-overflow {
overflow: visible;

.pgn__modal-body {
overflow: visible;
}
}
}

// Sizes
Expand Down

0 comments on commit 6b611a0

Please sign in to comment.