Closed cabello closed 4 months ago
Thanks for the clear and detailed write-up! I don't have time to look into this myself right now (likely until late next week), but just pinging @BRAiNCHiLD95 who has been really helpful with this stuff in the past, just in case he has any ideas!
@jackocnr Thanks for reaching out! Managed to squeeze in a codepen repro between my Canada Day weekend celebrations!
@cabello I've tried (and failed) to reproduce this in a codepen. I can see the placeholder auto-update every time.
I've taken all numbers from quackr.io and also kept in some of the validation and helper functions I have previously used - (just a helpful button to test add one number per country in your list of initOptions).
There may be a difference in terms of how/when "data" is updated in your codebase. Feel free to make a fork/new codepen that shows us the error - would be easier for us to debug.
Thanks so much for your input here @BRAiNCHiLD95 š
As you say, it seems to be working as intended in your codepen, so without the op's further input, we can only assume it is some of their own custom code causing the problem.
Closing due to inactivity.
Turns out the issue was on our codebase. AFAIK intl-tel-input is "uncontrolled", it tracks the data changes itself and has a few callback bridges to React land.
We were rendering the input once with empty values, then a second time with some values and changing a few props, that was causing unexpected behaviour, like the flag not showing up, formatting not working as expected.
Once I changed the approach to only render the input once I have all the data necessary to give to it, everything works as expected! š
Thank you for this library, it's awesome š¤
Hello there š
Plugin version
23.1.0
Steps to reproduce
This is using the React component.
ref
to set the phone numberExpected behaviour
Placeholder to change upon changing country.
Actual behaviour
Initialisation options
Minimum steps to reproduce
Thank you for making this project :purple_heart: