-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
fix(components): [radio checkbox] fix click event triggered twice #13936
Conversation
👋 @FrontEndDog, seems like this is your first time contribution to element-plus.
|
Hello @FrontEndDog, thank you for contributing to element-plus, please see our guideline to see how to make contribution |
🧪 Playground Preview: https://element-plus.run/?pr=13936 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like a bug, but I wonder if there are many use cases for doing something with @click events on checkboxes and radio buttons. 🤔
Whether used or not, triggering a click event twice is itself an error。 I came up with a scene,if click card edge,Triggered once,if click radio,Triggered twice |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @tolking
Thank for your contribution. I do not think this is a BUG, You can use the change event instead of the click event. If add the |
The issue you mentioned will only appear in the native input and label,will not appear in element plus。 because input in element-plus is hidden。 |
To supplement, This issue was discovered when I was using el-dropdown, if I use So I should use |
what you said makes sense. Thank for your contribution |
…ement-plus#13936) fix(components): [radio checkbox] @click event triggered twice
…ement-plus#13936) fix(components): [radio checkbox] @click event triggered twice
Please make sure these boxes are checked before submitting your PR, thank you!
dev
branch.Description
if I using radio or checkbox in dropdown,@command will trigger twice
This problem is caused by input and label
look here
Related Issue
Fixes #___.
Explanation of Changes
🤖 Generated by Copilot at 4f66a48
@click.stop
modifier toel-button
andel-checkbox
components incheckbox-button.vue
andcheckbox.vue
files (link, link, link, link)@click.stop
modifier toel-button
andel-radio
components inradio-button.vue
andradio.vue
files (link, link)