Skip to content

Commit 8ba7ae8

Browse files
authored
[Modal] -fixing max height: 80vh (#128)
1 parent f2fc757 commit 8ba7ae8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/Containers/Modal/styled.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ export const modalContainerStyles = (
2626
}
2727
const computedWidth = width || widthMap[size] || '240px'
2828
const computedMaxHeight = maxHeight || maxHeightMap[size] || '560px'
29+
const cappedMaxHeight =
30+
computedMaxHeight === 'unset' ? '80vh' : `min(${computedMaxHeight}, 80vh)`
2931
let computedHeight = 'auto'
3032
if (height) {
3133
computedHeight = height
@@ -37,7 +39,7 @@ export const modalContainerStyles = (
3739
max-width: 100%;
3840
width: ${computedWidth};
3941
height: ${computedHeight};
40-
max-height: ${computedMaxHeight};
42+
max-height: ${cappedMaxHeight};
4143
background-color: ${getThemedColor('neutral', 100)};
4244
border: 1px solid ${getThemedColor('neutral', 300)};
4345
border-radius: 4px;

0 commit comments

Comments
 (0)