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

3.X版本switch,changing状态可能导致锁死 #3140

Closed
Ryan-CW-Code opened this issue Apr 1, 2025 · 1 comment · May be fixed by #3143
Closed

3.X版本switch,changing状态可能导致锁死 #3140

Ryan-CW-Code opened this issue Apr 1, 2025 · 1 comment · May be fixed by #3143

Comments

@Ryan-CW-Code
Copy link
Contributor

NutUI React 包名

@nutui/nutui-react

NutUI React 版本号

3.0.6

平台

weapp

重现链接

重现步骤

3.x版本switch增加了changing状态,但是组件库默认一定会chang成功。
现实中很多情况,不会直接进行更改状态。比如点击switch时进行弹窗,在弹窗内进行操作,如果点击了取消弹窗。
因为取消了弹窗switch的value值并没有改变,switch组件的changing状态就永远不会改变,再点击switch时就无法触发事件。

可以考虑增加一个props是否打开changing状态,或者将changing状态设置为可以受控

期望的结果是什么?

可以正常多次点击

实际的结果是什么?

无法多次点击

环境信息

No response

其他补充信息

No response

@irisSong irisSong linked a pull request Apr 2, 2025 that will close this issue
20 tasks
@irisSong
Copy link
Collaborator

irisSong commented Apr 2, 2025

感谢反馈,下个版本解决

@irisSong irisSong linked a pull request Apr 3, 2025 that will close this issue
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants