Skip to content
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

Closed
niujianqiang123 opened this issue Dec 21, 2022 · 9 comments · Fixed by react-component/drawer#370 or #39782
Closed

Drawer组件无法关闭 #39711

niujianqiang123 opened this issue Dec 21, 2022 · 9 comments · Fixed by react-component/drawer#370 or #39782

Comments

@niujianqiang123
Copy link

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组件无法隐藏

const [open, setOpen] = useState(false);
<Drawer
        title='选择'
        placement='right'
        onClose={onClose}
        open={open}
      >
        <p>Some contents...</p>
        <p>Some contents...</p>
        <p>Some contents...</p>
      </Drawer>

What is expected?

open属性改变为false时,Drawer可以正常关闭

What is actually happening?

open属性改变为false时,Drawer无法关闭

Environment Info
antd 4.24.5
React 17
System macOS Monterey 12.6
Browser Chrome 108.0.5359.124(正式版本) (arm64)
@MadCcc MadCcc added the 🤔 Need Reproduce We cannot reproduce your problem label Dec 21, 2022
@github-actions
Copy link
Contributor

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 Need Reproduce will be closed if no activities in 3 days.

你好 @niujianqiang123, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击这里创建一个 antd@5.xantd@4.x 的 codesandbox,或者提供一个最小化的 GitHub 仓库。3 天内未跟进此 issue 将会被自动关闭。

@yoyo837
Copy link
Contributor

yoyo837 commented Dec 21, 2022

Fixed in #39561

@yoyo837 yoyo837 closed this as completed Dec 21, 2022
@yoyo837 yoyo837 reopened this Dec 22, 2022
@candy4290
Copy link
Contributor

我尝试复现:https://codesandbox.io/s/ji-chu-chou-ti-antd-4-24-5-forked-xc9jgn?file=/demo.tsx
但是没有发现任何问题 @niujianqiang123

@niujianqiang123
Copy link
Author

niujianqiang123 commented Dec 22, 2022 via email

@afc163
Copy link
Member

afc163 commented Dec 22, 2022

@niujianqiang123 最新的 4.x 版本已无法重现你描述的问题,请确认。

@niujianqiang123
Copy link
Author

niujianqiang123 commented Dec 22, 2022 via email

@afc163
Copy link
Member

afc163 commented Dec 22, 2022

那移除 lock 文件重新按照 node_modules 即可,semver 会安装到最新 rc-drawer 的。

@afc163 afc163 closed this as completed Dec 22, 2022
@niujianqiang123
Copy link
Author

niujianqiang123 commented Dec 22, 2022 via email

@afc163 afc163 reopened this Dec 22, 2022
@MadCcc
Copy link
Member

MadCcc commented Dec 22, 2022

rc-drawer 已经发布了 6.1.0,配套升级:#39561

@MadCcc MadCcc closed this as completed Dec 22, 2022
@afc163 afc163 reopened this Dec 24, 2022
afc163 added a commit to react-component/drawer that referenced this issue Dec 24, 2022
afc163 added a commit to react-component/drawer that referenced this issue Dec 24, 2022
* fix: Drawer default props

close ant-design/ant-design#39711
close ant-design/ant-design#39777

* test: add test case for defaut props
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants