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

.invalid class not toggled correctly in atomic groups #26

Open
bboyle opened this issue Aug 2, 2012 · 2 comments
Open

.invalid class not toggled correctly in atomic groups #26

bboyle opened this issue Aug 2, 2012 · 2 comments
Labels

Comments

@bboyle
Copy link
Owner

bboyle commented Aug 2, 2012

Improve handling of .invalid class for atomic groups.

After submit, .invalid is applied to invalid questions and groups within a form.

If an atomic group is valid at submit, the group is not classed as .invalid (this is correct)
If an invalid entry is made within the group, the question is classed as .invalid (this is correct)
If an invalid entry is made within the group, the group is not classed as .invalid (this is INCORRECT)

If an atomic group is valid at submit, the group is classed as .invalid (this is correct)
If an invalid entry is corrected, the question is no longer classed as .invalid (this is correct)
If all invalid entries are corrected, the group is no longer classed as .invalid (this is correct)
If an invalid entry is corrected, but invalid questions remain, the group is no longer classed as .invalid (this is INCORRECT)

@bboyle
Copy link
Owner Author

bboyle commented Aug 2, 2012

Won't fix.

This is standard behaviour. If an invalid field is corrected, the .invalid class should be removed.
If an invalid entry is made again, the .invalid class is not restored until submit.

@bboyle bboyle closed this as completed Aug 2, 2012
bboyle added a commit that referenced this issue Aug 2, 2012
added new tests, verified correct behaviour for #26
@bboyle bboyle reopened this Aug 3, 2012
@bboyle
Copy link
Owner Author

bboyle commented Aug 3, 2012

Alerts are handled correctly but .invalid class remains.

This may relate specifically to questions where the validity state is related to another field. For example, 'Card has expired' on credit card form where expiry is an atomic group composed of MM and YY fields. Fixing either field may correct the error.

  1. set custom error on 2 fields within atomic group
  2. submit form (invalid class will be applied)
  3. clear the custom error on both fields, but only trigger change on one field
  4. the field in the change event will be correctly updated, the other field will still have the .invalid class

Should the check validity onchange handler be invoked for every field within the atomic group?
(Make sure that does not cause an infinite loop!)

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

No branches or pull requests

1 participant