gcanti / tcomb-form

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

Does select value has to be text? #338

Closed jcristovao closed 8 years ago

jcristovao commented 8 years ago

Version

Tell us which versions you are using:

I changed a t.number to use a t.form.Select as a factory, and I even give it an options array where the values are all numbers.

Actual behaviour

Instead, it seems Select always assumes string, as stated in custom-options.

How easy would it be to also allow numbers as a valid value on a select? Can it be done on the original code although I'm not sure where, or would I have to do a custom factory (I'm not sure how to start with the least amount of code duplication possible).

Tks!

jcristovao commented 8 years ago

Ok, I found it! I just have to use a transformer. Sorry about the noise