Replies: 1 comment
|
I'm really sorry - I seem to have forgotten to reply to this one, and I see it's now over a year old - forgive me! I'm guessing this is no longer a pressing issue for you, but in case it's helpful, a few thoughts: you're importing the component from reactWithUtils, so there's no need to use loadUtils as well as you already have it. Then there's your useEffect, which seems to be loading utils again (a third time!) - you can safely get rid of this. As for your handleCountryChange method - you seem to be manually trying to update the placeholder yourself - again, I would just get rid of this code as the plugin does this for you automatically. If you're still having issues, I would suggest updating to the latest version, and if the issue is still happening, create a codepen (etc) to show the problem so I can help debug it. For your reference, here are the react component docs and the react example page. Again, apologies for missing this. All the best. |
Uh oh!
There was an error while loading. Please reload this page.
Hello!
First off, I want to say thank you for creating
intl-tel-input—it’s been incredibly helpful, and I appreciate all the effort that has gone into maintaining this repository!I’m currently using the
intl-tel-inputReact component and trying to implement auto-placeholder functionality based on the selected country. However, I’ve run into an issue where the placeholder always remains set to the U.S. format, regardless of the selected country.Here’s my component implementation:
To ensure utils.js is loaded, I have this
useEffect:And here’s my
handleCountryChangefunction:Related imports are the following:
Despite this setup, the placeholder text doesn’t update when the country changes—it remains in the U.S. format. I could continue troubleshooting, but I figured it would be best to ask the experts who built it!
Is there anything I might be missing to enable auto-placeholder updates properly?
Thanks in advance for your time and help! I appreciate it.
All reactions