question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it possible to customize the country text displayed in each `<option>` of the dropdown?

See original GitHub issue

Hi! We’d like to be able to display the country code next to the country name in the dropdown like so: new (Every code would obviously not be +444) I see someone else wanted to display the country code later in issue #7 and you suggested onCountryChange. Is this still a viable option? Or would there be another way for us to accomplish this? Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
catamphetaminecommented, May 31, 2019

onCountryChange is not for dropdown. Displaying country codes is not supported in the current version. One can supply their own country labels, see the README for more info. Those labels can be constructed from the default labels by appending country codes via getCountryCallingCode() function from libphonenumber-js.

0reactions
Kyle-Skicommented, May 31, 2019

That solved it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How Can I customize the entries in the Country Dropdown ...
I am currently using ShipperHQ for shipping and the Optimized One-Page checkout. In the country field, I get all countries in the world...
Read more >
javascript - Show country code based on user selection ...
I want the user to choose his/her country from a drop-down list, Then I want to show the country code in a text...
Read more >
How to change the HubSpot country property to a dropdown ...
To do this, click the Choose options dropdown, and then select Country. Once you click that Load options button, HubSpot will load those...
Read more >
How to Add a Country Dropdown List to Your WordPress ...
In this article, we'll show you how to add countries to a dropdown in WordPress. This is a really easy method that requires...
Read more >
Converting Address' Country Field to a Dropdown
This article will cover how to change the address' Billing Country field to a dropdown list which will allow users to select a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found