Country change does not trigger onChange event
Hi,
We have a form where we have a phone input and a country input.
When we select a country, we update the phone input with the selected new country.
Here is our current issue:
1- enter an invalid phone number in phone input => our validation fails and the "invalid-number" class is added to the input
2- select another country from the country input
=> issue: the phone input country is updated, the input is cleared BUT the "invalid-number" class is still here
This happens because the onChange event is not called on country change.
We are using phone input within a controller, so as a workaround we set a key key={selectedCountry} attribute on the controller.
Anyway thanks for this great library, it is of great use for us!
Moreover, if you combine a pre-set country with the required input prop, you can submit the form but onChange was never called, so our model still has an undefined