From 53e52b404ccdcedf0866bf513948732ee6e66053 Mon Sep 17 00:00:00 2001 From: Jiahao Li Date: Sun, 9 Aug 2020 23:01:20 +0800 Subject: [PATCH 1/2] fix: dialog is not visible, when initialize dialog with forceRender and visible is true --- examples/ant-design.tsx | 34 ++++++++++++++++++++++++++++++++++ src/Dialog.tsx | 3 +++ tests/index.js | 30 ++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+) diff --git a/examples/ant-design.tsx b/examples/ant-design.tsx index 466a9f39..c74dd3a7 100644 --- a/examples/ant-design.tsx +++ b/examples/ant-design.tsx @@ -31,6 +31,7 @@ class MyControl extends React.Component { state = { visible: false, visible2: false, + visible3: true, width: 600, destroyOnClose: false, center: false, @@ -62,6 +63,10 @@ class MyControl extends React.Component { }); } + onClose3 = (e: React.SyntheticEvent) => { + this.setState({ visible3: false }); + } + onDestroyOnCloseChange = (e: React.ChangeEvent) => { this.setState({ destroyOnClose: e.target.checked, @@ -143,6 +148,13 @@ class MyControl extends React.Component { >

basic modal

+ + + + +
+ + ); + return (