jurassix / react-validation-mixin

Simple validation mixin (HoC) for React.
MIT License
283 stars 38 forks source link

The index of an incorrect array entry is returned instead of the field name #39

Closed boldt closed 8 years ago

boldt commented 8 years ago

As described in the Documentation, you can get the error message for a given field with this.getValidationMessages('name').

If the field is an array, the field name is set to "0", "1", which means that I cannot get the error message for a field with an array.

Small Example: getValidationMessages() gives me a result like this:

[
  ""0" must be one of [admin, moderator]",
  ""1" must be one of [admin, moderator]"
]

I also reporeted this issue in the Joi project: https://github.com/hapijs/joi/issues/721

Additionally, the error messages doesn't clear, which is already issued in #38.

jurassix commented 8 years ago

This has been fixed with 5.2.0: https://github.com/jurassix/react-validation-mixin/releases/tag/v5.2.0

jurassix commented 8 years ago

Ensure you upgrade joi-validation-strategy to v0.2.1

boldt commented 8 years ago

Looks good as well!