Skip to content

Core: added radio/checkbox to delegate click-event #1126

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
wants to merge 1 commit into from
Closed

Core: added radio/checkbox to delegate click-event #1126

wants to merge 1 commit into from

Conversation

larslaade
Copy link
Contributor

Validation should work on click with radio/checkbox-elements.

@jzaefferer
Copy link
Collaborator

This reverts part of the change in d319a0d - the discussion in #1065 never mentioned those removals, I'm not sure how I missed them. @staabm was there a reason for removing those?

@staabm
Copy link
Member

staabm commented May 23, 2014

seems like those were dropped while reworking the patch but not intentionally.

@larslaade may I ask whats your use case is? when a user clicks a radio/checkbox the validiation should already be triggered by the focus-event.

Do you trigger click events on the field to start validation via DOM api?

@larslaade
Copy link
Contributor Author

@staabm when the form validates and there are errors on radio/checkboxes, i click on those directly and the messages are not removed. when i use the version of my fork the messages are removed on click. Yes, they are removed when tabbing to the next input, but not when hitting space or clicking on it to select the radio/checkbox.
No, i don't trigger click-events to start validation.

@staabm
Copy link
Member

staabm commented May 23, 2014

hmm thats strange. Does you radio/checkbox already has the focus before you click on it?

@jzaefferer
Copy link
Collaborator

Landed, thanks for the patch. Good to have this fixed before a new release.

});

events = [
$.Event("click")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jzaefferer I am not sure about this test-case... it actually only tests that click handlers are delegated, but thats not what browsers would do.

In a perfect world the focus event which is triggered before the click is dispatched would already have triggered the validation.

IMO the test should reflect what the issue actually was - clicking a invalid-radio/checkbox after validation should make it valid again.
I am aware that this test is more or less a copy of the test I added recently, but the point of my PR was to add those event handlers, therefore it was legit in my eyes.

@larslaade
Copy link
Contributor Author

@staabm @jzaefferer I've added a different test for that in #1128

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.

3 participants