formData after rules are applied
oscar-broman opened this issue · comments
If I have a simple rule that conditionally removes a field, how can I get a version of formData
that does not include that field?
Currently, { formData }
in onChange
and onSubmit
contains all fields, including those which are conditionally removed (i.e. hidden). Is this by design, or a bug on my end?
If my explanation is unclear I can provide a repro.
@oscar-broman remove - removes data from schema and uiSchema, but it does not affect formData. This is done in order to keep filled value if for some reason field will reappear. We are not going to change this behavior on our end.
You should define another action removeFromFormData, that would do what you want. Refer to documentation, on how to do that. You would sadly need to copy the original condition twice, until #38 is fixed.
I've fixed #38 and released a new version, where you can use array of events in rules definition
Nice! Thank you. I'll give it a try.