gcanti / tcomb-form

Forms library for react
https://gcanti.github.io/tcomb-form
MIT License
1.16k stars 136 forks source link

0.9.12 release break default List behaviuor #379

Closed gbiryukov closed 7 years ago

gbiryukov commented 7 years ago

Version

Expected behaviour

Default value of new list items should be undefined

Actual behaviour

Default value of new items is instance of SyntheticMouseEvent. It cause weird validation errors messages on new list items

Steps to reproduce

  1. Create custom list template and use it with default List factory
  2. Pass add click handler from locals to any button as prop i.e. <button type="button" onClick={locals.add.click} />
  3. Press this button and you will receive SyntheticMouseEvent as new item in list
gcanti commented 7 years ago

/cc @karlguillotte

karlguillotte commented 7 years ago

Yeah! Right. Did not get that problem as I was calling that function myself from my template. Sorry about that. Perhaps you could revert my change and I will just extend the list component myself.

gcanti commented 7 years ago

Perhaps you could revert my change and I will just extend the list component myself

Ok, thanks @karlguillotte

gcanti commented 7 years ago

Reverted in https://github.com/gcanti/tcomb-form/releases/tag/v0.9.13