Fields inside <Conditional> do not immediately populate in validator object
- Dominant language
- JavaScript
- Stars
- 187
- Forks
- 16
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 3
Description
Fields placed inside a `` only populate in the validator object after another field is modified.
```
const formValidator = v => {
console.log(v)
// Validation
}
Yes or no?
yesOrNo === 'No'}>
Really? Why not?
Another field
```
After choosing "no," the object should be `{ yesOrNo: 'No', whyNot: null, anotherField: null }`. Instead, the resulting object is just `{ yesOrNo: 'No', anotherField: null }`. Even submitting the form won't cause the key to populate; it only shows up after changing "Another field."
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the provided Formol example with Conditional, Field, and the validator callback, then trace how Conditional fields enter the validator object after selecting “No.” Done means the validator object immediately includes { whyNot: null } alongside yesOrNo and anotherField, including when the form is submitted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100