Is it possible to customize the country text displayed in each `<option>` of the dropdown?
See original GitHub issueHi!
We’d like to be able to display the country code next to the country name in the dropdown like so:
(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:
- Created 4 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
onCountryChange
is not for dropdown. Displaying country codes is not supported in the current version. One can supply their own countrylabels
, see the README for more info. Those labels can be constructed from the default labels by appending country codes viagetCountryCallingCode()
function fromlibphonenumber-js
.That solved it!