Phone number Input Component not picking Country code automatically

Hello Team,

I've used the Phone number input component and on the Default value I've put the Country code + Mobile number value,
Now it's come from the API call and when I open that Container it's not reflecting the correct Country code,

If I try to change the value of the mobile number and put that value back, then it shows the correct country code.

Steps to reproduce:

  • have a list of users, on click of view details call a query to fetch the user data
  • Now in the query, you will get the country code and mobile number,
  • I'm combining them and putting them as the default value to Phone Number Input.
  • You can check there is not correct Country code, If you just try to change the mobile number's last digit and put it back the correct country code is visible now.

PS: you need to have a different country mobile number to reproduce

Here you can check there is a UK number and country selected as India

image

Hey @Darren,

Could you please take a look at this?

Hi @kaif_mtech, are we on Cloud or Self-hosted Retool? I'm trying to reproduce this on Cloud but I only run into a similar issue with the label if the phone number saved on the db doesn't have spaces.

For example, when I first select a row in the table where the number has no spaces:
Screenshot 2024-09-11 at 9.25.28 AM

But after the space is added or a different row with spaces is selected:
Screenshot 2024-09-11 at 9.26.05 AM

Here is the component when a row with +44 and spaces is selected:
Screenshot 2024-09-11 at 9.28.56 AM

Hello @Paulo,
Thanks for your response.

Yes, I'm also on Cloud, and in the same way, I've tried to add space manually but it didn't work for me.
Here is the screenshot for the same
image
image

And If I'm not adding the space then also it behaves the same.
image
image