Ticket #346 (closed defect: fixed)
valid/invalid class is not added the first time a field value is entered
| Reported by: | sdm | Owned by: | freya |
|---|---|---|---|
| Priority: | major | Milestone: | 0.4 |
| Component: | modules/kauri-forms | Version: | trunk |
| Keywords: | Cc: | kauri-discuss@… |
Description
This can be reproduced in the kauri-forms-sample, on page basic-controls1.html. You will need to comment out the setWireValue, or add the noValidation=true parameter.
If a value is entered in the "name" field and the focus is lost, the valid class will not be added. When you then change the value of the "name" field, the valid class will be added. I've seen this behaviour with string, integer and boolean fields (it doesn't seem to happen with date fields).
I've also added an integer field "count" to this form. When I enter a string value into this "count" field, the message "not a valid number" is shown, but the "invalid" class will only be added the second time an invalid value is entered.
I've noticed that if a custom validator is added, the behaviour is correct. You can see this with the "email" field: if you enter a valid or invalid email, the corresponding CSS class will be added immediately. If you remove the custom validator and you enter a valid string value, the valid class will only be added the second time a value is entered.
Change History
comment:1 Changed 3 years ago by freya
- Owner changed from mpo to freya
- Status changed from new to assigned
comment:2 Changed 3 years ago by freya
- Status changed from assigned to closed
- Resolution set to fixed
should be fixed in #346
comment:3 Changed 3 years ago by sdm
- Status changed from closed to reopened
- Resolution fixed deleted
The valid class seems to be added correctly, but when typing a string value in an integer or time field for example, the invalid class is not added before you type an invalid value for the second time.