react-forms icon indicating copy to clipboard operation
react-forms copied to clipboard

Validation error when using number type

Open stavenko opened this issue 9 years ago • 4 comments

Hello.

I got one simple error. When i define property type 'number', and try to make some input, values from inputs are not casted to numbers and validated against there types, which are 'string's. This causes error list to be populated even when there's no non-digit literals within input data.

stavenko avatar Feb 25 '16 16:02 stavenko

You need a custom input component for this, React Forms doesn't provide one at the moment.

andreypopp avatar Feb 25 '16 16:02 andreypopp

Could you provide some simple example in docs showing how to implement it?

stavenko avatar Feb 25 '16 16:02 stavenko

may be something along the lines https://github.com/prometheusresearch/react-forms/issues/116 ?

bsr203 avatar Feb 25 '16 16:02 bsr203

Yeah, example pointed by @bsr203 is a good one. I'll leave this issue open not to forget to add this to the docs.

andreypopp avatar Feb 25 '16 17:02 andreypopp