-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not working properly with MUI and asynchronous calls #175
Comments
Hey @Loschcode! If you change |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.The text was updated successfully, but these errors were encountered: