From 6b611a0cdf4a65826a3ce48491ea173a35a3ce16 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Fri, 15 Dec 2023 12:33:46 -0500 Subject: [PATCH] feat: allow consumers to configure ModalDialog to allow overflow --- src/Modal/ModalDialog.jsx | 5 +++++ src/Modal/_ModalDialog.scss | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/src/Modal/ModalDialog.jsx b/src/Modal/ModalDialog.jsx index 926d4bdcea..bd8657d917 100644 --- a/src/Modal/ModalDialog.jsx +++ b/src/Modal/ModalDialog.jsx @@ -30,6 +30,7 @@ function ModalDialog({ isFullscreenOnMobile, isBlocking, zIndex, + isOverflowVisible, }) { const isMobile = useMediaQuery({ query: '(max-width: 767.98px)' }); const showFullScreen = (isFullscreenOnMobile && isMobile); @@ -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, )} @@ -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 = { @@ -133,6 +137,7 @@ ModalDialog.defaultProps = { isFullscreenOnMobile: false, isBlocking: false, zIndex: undefined, + isOverflowVisible: false, }; ModalDialog.Header = ModalDialogHeader; diff --git a/src/Modal/_ModalDialog.scss b/src/Modal/_ModalDialog.scss index 9526fce91a..1a5c71f7d9 100644 --- a/src/Modal/_ModalDialog.scss +++ b/src/Modal/_ModalDialog.scss @@ -38,6 +38,14 @@ top: calc(#{$modal-inner-padding} / 2 * -1); } } + + &.pgn__modal-visible-overflow { + overflow: visible; + + .pgn__modal-body { + overflow: visible; + } + } } // Sizes