Skip to content

Commit

Permalink
Merge pull request #2236 from XiaoMi/hotfix/#2235
Browse files Browse the repository at this point in the history
fix(modal): 修改max-height值的设定
  • Loading branch information
solarjoker authored Sep 14, 2022
2 parents 22919a9 + d8b9cc0 commit 51c153c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 6 additions & 1 deletion packages/ui/modal/src/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const modalIconMap = {
[ModalType.WARNING]: <ExclamationCircleFilled />,
[ModalType.INFO]: <InfoCircleFilled />,
}
const defaultMaxHeight = 600

/**
* TODO: What is Modal
Expand Down Expand Up @@ -135,7 +136,11 @@ export const Modal = forwardRef<HTMLDivElement | null, ModalProps>(
{showMask ? <div className={`${prefixCls}__overlay`} /> : null}
<div
className={`${prefixCls}__wrapper`}
style={{ width, height }}
style={{
width,
height,
maxHeight: height && height > defaultMaxHeight ? height : defaultMaxHeight,
}}
{...getModalWrapperProps()}
>
{hasHeader ? (
Expand Down
3 changes: 0 additions & 3 deletions packages/ui/modal/src/styles/modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,14 @@ $modal-overlay-background-color: rgba(0, 0, 0, 0.45) !default;

.#{$prefix}--size-sm & {
width: 400px;
max-height: 600px;
}

.#{$prefix}--size-md & {
width: 520px;
max-height: 600px;
}

.#{$prefix}--size-lg & {
width: 720px;
max-height: 600px;
}

.#{$prefix}--motion-enter & {
Expand Down

0 comments on commit 51c153c

Please sign in to comment.