Skip to content

单选组件 components/vc-checkbox/src/Checkbox.jsx 的change事件中传递的event的nativeEvent不是一个完整的事件对象 #1810

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

Closed
1 task
Tindtily opened this issue Feb 21, 2020 · 3 comments
Labels

Comments

@Tindtily
Copy link
Contributor

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

undefined

Environment

基本上任何环境都一样

Reproduction link

Edit on CodeSandbox

Steps to reproduce

单击重现链接中的radio

What is expected?

nativeEvent应该有target、currentTarget等原始事件的属性

What is actually happening?

现在只有isTrusted和shiftKey两个属性


我们在使用单选按钮时,需要在改变前给用户提示。但是现在radio只有change事件,没有beforeChange事件。只能在change中通过event找到原始的target,然后改变其checked属性。

@sendya
Copy link
Member

sendya commented Feb 21, 2020

善用 Vue 的特性(绑定 + 数据驱动)

https://codesandbox.io/embed/heuristic-mcnulty-sove7?fontsize=14&hidenavigation=1&theme=dark

@Tindtily
Copy link
Contributor Author

善用 Vue 的特性(绑定 + 数据驱动)

https://codesandbox.io/embed/heuristic-mcnulty-sove7?fontsize=14&hidenavigation=1&theme=dark

谢谢,不过我的情况不仅仅是一个radio这么简单,我只是举一个例子,来说明期望的结果。既然取名nativeEvent,但是实际上与原生event差很多,不是bug是什么呢?

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants