christianalfoni / formsy-react

A form input builder and validator for React JS
MIT License
2.6k stars 438 forks source link

`onChange` doesn't provide mapped model #478

Open amannn opened 6 years ago

amannn commented 6 years ago

It looks like the data that is passed as the first argument to onChange is from getCurrentValues which doesn't call mapModel, therefore dots within field names aren't resolved to nested objects.

However onSubmit is passed the mapped model.

Is there a reason for this behaviour? From my perspective it would be correct to also map the model that is passed to onChange. It looks like there was some discussion about this in #224, but this never made it to the code base.

Would you be open to a PR implementing the proposed change? Thanks!