edwardfxiao/react-inputs-validation

Remove error message when value of field is updated

Closed this issue · 1 comments

When you validate your input field once and the error message appear, if you update the value from other methods (I tried by getting the value from an api call and updating the value in state, which updates the value but message still remains) than focussing the input field and trying to update it, the message won't go away, even if you trigger the validation by setting validate to true. the only option is to click on the input field and onBlur it will validate the specific field and remove the message.

Describe the solution you'd like
If the same validation happening on blur event, could be done for validate as well, I think it'll be better.

Hi @sdevil7th , please check v2.1.6, which should fix this problem if I understand you correctly.
Demo: https://codesandbox.io/s/zkp7mxry4x