Skip to content

Use 'click' event for checkbox and radio (fix #4620) #4639

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

Merged
merged 2 commits into from
Jan 4, 2017
Merged

Use 'click' event for checkbox and radio (fix #4620) #4639

merged 2 commits into from
Jan 4, 2017

Conversation

defcc
Copy link
Member

@defcc defcc commented Jan 3, 2017

fix #4620

  1. use click event instead of change event.
  2. add test case for checkbox can not be selected if it's in a element with @click listener? #4521

@sirlancelot
Copy link

Will this event still trigger if someone isn't clicking it? For instance, through keyboard tabbing & spacebar?

@defcc
Copy link
Member Author

defcc commented Jan 3, 2017

According to https://www.w3.org/TR/uievents/#legacy-uievent-event-order
keyboard's spacebar will change the checkbox's checked status and trigger click event. If the browser supports the spacebar, it should also trigger the click event.

It does on my Mac chrome, I'll have a check on IE's behavior and IE also has consistent behavior.

@yyx990803 yyx990803 merged commit da955d1 into vuejs:dev Jan 4, 2017
@yyx990803
Copy link
Member

Hmm, the CI failed after merging (but it was passing for the PR itself...) Need to investigate a bit more.

@defcc
Copy link
Member Author

defcc commented Jan 5, 2017

I'll take a look.

@defcc
Copy link
Member Author

defcc commented Jan 5, 2017

Something wrong with the checkbox test case. The checkbox and radio need the same test case, so I made a mistake when doing it. I'll check why it works in the PR.

@defcc
Copy link
Member Author

defcc commented Jan 5, 2017

@yyx990803 Found that I worked on the Version 2.1.7 with the true-value equal issue, so the wrong test case was passing. Sorry for that mistake, I'll update it.

@defcc defcc mentioned this pull request Jan 5, 2017
@defcc
Copy link
Member Author

defcc commented Jan 5, 2017

I'll also update the contribution guide later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Checkbox :checked is not fully reactive when checkbox is in focus
3 participants