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 Dec 19, 2023
1 parent b5c0510 commit 2f7f60c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 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 @@ -117,6 +119,7 @@ ModalDialog.propTypes = {
*/
isBlocking: PropTypes.bool,
zIndex: PropTypes.number,
isOverflowVisible: PropTypes.bool,
};

ModalDialog.defaultProps = {
Expand All @@ -130,6 +133,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 2f7f60c

Please sign in to comment.