Skip to content
Permalink
Browse files
fix: alert close optimization (#24460) (#24460)
Co-authored-by: Yunfly <qinfy@knownsec.com>
  • Loading branch information
Yunfly and Yunfly committed Jul 10, 2020
1 parent d664584 commit dd8e9f8568aa8b7ffd4e4de5fcbce200cdf6ae94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
@@ -88,13 +88,6 @@ const Alert: AlertInterface = ({
const prefixCls = getPrefixCls('alert', customizePrefixCls);

const handleClose = (e: React.MouseEvent<HTMLButtonElement>) => {
e.preventDefault();
const dom = ref.current as HTMLElement;
dom.style.height = `${dom.offsetHeight}px`;
// Magic code
// 重复一次后才能正确设置 height
dom.style.height = `${dom.offsetHeight}px`;

setClosing(true);
props.onClose?.(e);
};
@@ -7,6 +7,7 @@
.reset-component;

position: relative;
max-height: 1000vh;
padding: 8px 15px 8px 37px;
word-wrap: break-word;
border-radius: @border-radius-base;
@@ -146,7 +147,7 @@
}

&&-closing {
height: 0 !important;
max-height: 0;
margin: 0;
padding-top: 0;
padding-bottom: 0;

0 comments on commit dd8e9f8

Please sign in to comment.