Open Loschcode opened 7 months ago
Hey @Loschcode!
Are you sure that the phone value that you are setting asynchronously starts with +
?
Can you also share a piece of logic where you are setting a new phone value to the phone input, please? 🙏
If you change value
prop everything should work fine...
I'm using GraphQL and will receive some phone asynchronously. Long story short, the example in your documentation is not working properly because it doesn't take into consideration asynchronous data coming in.
The problem is that in your implementation you don't make any difference between
onChange
from the client andonChange
from your own system adding the country code (e.g.+1
) so in my case I'm having my API response being overwritten by an additional+1
for no reason.The only workaround I found was to detect
onFocus
and activateonChange
once the user actually goes on that phone input.This is an abstract of my solution, it's not perfect. A better solution would be to avoid firing
onChange
when initializing the country code, or at least have another type of event for that.