bietkul / react-reactive-form

Angular like reactive forms in React.
MIT License
309 stars 32 forks source link

Form status undefined for asyncValidator results #43

Open cyberwombat opened 5 years ago

cyberwombat commented 5 years ago

Describe the bug I am using the async validator example you provided and added a listener to the form to watch status change. Works fine for sync validators but for async it first provides PENDING as expected but then, whether the validation passes or fail it returns undefined.

To Reproduce Steps to reproduce the behavior:

  1. Create a form with async validator
  2. Add listener such as myForm.statusChanges.subscribe((value) => { console.log(value)

Expected behavior I would expect VALID or INVALID

Desktop (please complete the following information):