diff --git a/package.json b/package.json index c2d295ec..50764f12 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rc-dialog", - "version": "8.0.0", + "version": "8.0.1", "description": "dialog ui component for react", "keywords": [ "react", diff --git a/src/Dialog.tsx b/src/Dialog.tsx index 6ae47823..7d824b9b 100644 --- a/src/Dialog.tsx +++ b/src/Dialog.tsx @@ -140,14 +140,18 @@ export default class Dialog extends React.Component { } onAnimateLeave = () => { - const { afterClose } = this.props; + const { afterClose, getOpenCount } = this.props; // need demo? // https://github.com/react-component/dialog/pull/28 if (this.wrap) { this.wrap.style.display = 'none'; } this.inTransition = false; - this.switchScrollingEffect(); + // 如果没有打开的状态,则清除 effect 和 overflow: hidden; + // https://github.com/ant-design/ant-design/issues/21539 + if (!getOpenCount()) { + this.switchScrollingEffect(); + } if (afterClose) { afterClose(); }