From 68b947289153db38c0a9f1b2793d19410ab265c6 Mon Sep 17 00:00:00 2001 From: jljsj Date: Mon, 8 Jun 2020 19:50:15 +0800 Subject: [PATCH] fix https://github.com/ant-design/ant-design/issues/21539 --- package.json | 2 +- src/Dialog.tsx | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) 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(); }