AppliedMathematicsANU / plexus-form

A dynamic form component for react using JSON-Schema.
MIT License
134 stars 31 forks source link

handleChange parses value twice #17

Open martijnvermaat opened 9 years ago

martijnvermaat commented 9 years ago

I think values are parsed twice in the handleChange handlers, since the parser is also called in the normalizer.

See this handler for example.

odf commented 9 years ago

Thanks for bringing that to my attention! Since normalizing and parsing are always done together, it might make more sense to have a single function that returns both the normalized text and the parsed value, if any.

We now have a bit of duplication between the input components, and more so after considering #18, so I think I should look into further refactoring some of that code. But first it's probably a good idea for me to sort out testing.