From 1531fe190c713359535ede760260e79e5e2ca114 Mon Sep 17 00:00:00 2001 From: LiJiahao Date: Wed, 19 Aug 2020 18:50:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20dialog=20is=20not=20visible,=20when=20in?= =?UTF-8?q?itialize=20dialog=20with=20forceRender=20a=E2=80=A6=20(#194)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: dialog is not visible, when initialize dialog with forceRender and visible is true * Update .travis.yml Co-authored-by: 偏右 --- .travis.yml | 2 +- examples/ant-design.tsx | 34 ++++++++++++++++++++++++++++++++++ src/Dialog.tsx | 3 +++ tests/index.js | 30 ++++++++++++++++++++++++++++++ 4 files changed, 68 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1d853fc2..313a4cbc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ notifications: - hust2012jiangkai@gmail.com node_js: -- 6.9.1 +- 10 before_install: - | 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 (