Skip to content
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

Invalid country data for French overseas territories #1604

Closed
DynamoRed opened this issue May 7, 2024 · 2 comments
Closed

Invalid country data for French overseas territories #1604

DynamoRed opened this issue May 7, 2024 · 2 comments

Comments

@DynamoRed
Copy link

DynamoRed commented May 7, 2024

Steps to reproduce

  1. Have an IP from an overseas territory (such as Guadeloupe, Martinique, etc.) in France
  2. Load a page with intl-tel-input and IPAPI configured as geoIpLookup callback

Expected behaviour

The phone number should have a French format and a French flag should appear

Actual behaviour

The error "No country data for 'gp'" appears and no flag or format is correctly selected by default

Initialisation options

  • IPAPI returns gp or mq for example for Guadeloupe and Martinique
  • The code for geoIpLookup is as follows:
geoIpLookup: callback => {
  fetch("https://ipapi.co/json")
    .then(res => res.json())
    .then(data => callback(data.country_code))
    .catch(() => callback("fr"));
},
@jackocnr
Copy link
Owner

jackocnr commented May 8, 2024

Can you log the value of data.country_code that is being passed to the callback?

Because when I test it, passing "gp", it seems to work fine: https://codepen.io/jackocnr/pen/mdYdbPa

Some more questions:

  • Which version of the plugin are you using?
  • Are you using any other initialisation options? e.g. onlyCountries?
  • Is there a number in the input when you initialise the plugin?

@jackocnr
Copy link
Owner

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants