New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drawer组件无法关闭 #39711
Drawer组件无法关闭 #39711
Comments
Hello @niujianqiang123. Please provide a online reproduction by forking codesandbox of antd@5.x or antd@4.x, or provide a minimal GitHub repository. Issues labeled by 你好 @niujianqiang123, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击这里创建一个 antd@5.x 或 antd@4.x 的 codesandbox,或者提供一个最小化的 GitHub 仓库。3 天内未跟进此 issue 将会被自动关闭。 |
|
open={open || visible}
// 当open为true,则这个表达式为true;
// 当open为false,则这个表达式为undefined;
// 建议更改为 visible || open; open应该在后面;
…------------------ 原始邮件 ------------------
发件人: "ant-design/ant-design" ***@***.***>;
发送时间: 2022年12月22日(星期四) 下午4:17
***@***.***>;
***@***.******@***.***>;
主题: Re: [ant-design/ant-design] Drawer组件无法关闭 (Issue #39711)
我尝试复现:https://codesandbox.io/s/ji-chu-chou-ti-antd-4-24-5-forked-xc9jgn?file=/demo.tsx
但是没有发现任何问题 @niujianqiang123
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@niujianqiang123 最新的 4.x 版本已无法重现你描述的问题,请确认。 |
rc-Drawer 6.0.2 可复现,6.0.3无复现
关键代码段, rc-Drawer内,猜测,这个处理内没有把open为undefined的情况进行处理,所以当open为false时;open: open || visible; 接收到的最终open值为undefined;
var props = _objectSpread(_objectSpread({}, defaultProps), drawerProps);
…------------------ 原始邮件 ------------------
发件人: "ant-design/ant-design" ***@***.***>;
发送时间: 2022年12月22日(星期四) 下午4:17
***@***.***>;
***@***.******@***.***>;
主题: Re: [ant-design/ant-design] Drawer组件无法关闭 (Issue #39711)
我尝试复现:https://codesandbox.io/s/ji-chu-chou-ti-antd-4-24-5-forked-xc9jgn?file=/demo.tsx
但是没有发现任何问题 @niujianqiang123
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
那移除 lock 文件重新按照 node_modules 即可,semver 会安装到最新 rc-drawer 的。 |
嗯呢,感谢您的回复,我也想到了这个解决办法,但是最好还是在下个版本里修改代码,判断open为false;visible为undefined的情况,否则别人可能无法解决这个问题
…------------------ 原始邮件 ------------------
发件人: "ant-design/ant-design" ***@***.***>;
发送时间: 2022年12月22日(星期四) 下午4:41
***@***.***>;
***@***.******@***.***>;
主题: Re: [ant-design/ant-design] Drawer组件无法关闭 (Issue #39711)
那移除 lock 文件重新按照 node_modules 即可,semver 会安装到最新 rc-drawer 的。
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
rc-drawer 已经发布了 6.1.0,配套升级:#39561 |
* fix: Drawer default props close ant-design/ant-design#39711 close ant-design/ant-design#39777 * test: add test case for defaut props
Reproduction link
https://4x.ant.design/components/drawer-cn/#API
Steps to reproduce
1、引入Drawer组件
2、设置open属性和控制open属性的state状态
3、改变state为true,Drawer组件显示
4、改变state为false,也就是open属性为false,Drawer组件无法隐藏
What is expected?
open属性改变为false时,Drawer可以正常关闭
What is actually happening?
open属性改变为false时,Drawer无法关闭
The text was updated successfully, but these errors were encountered: