intl_phone_number_input
intl_phone_number_input copied to clipboard
[FEATURE] defaultCountryCode argument
When no valid initialValue
is passed to the InternationalPhoneNumberInput
widget, the first country in the list of provided countries is used. To make the widget a bit more user-friendly, I needed to be able to set the default country code.
I did this by changing the workings of Util.getInitialSelectedCountry()
and passing the defaultCountryCode
argument along. If no match is found in the list of countries for countryCode
, it will look for a match with defaultCountryCode
, if provided.
I couldn't find a way of achieving this using the current package, so I added this functionality myself. Let me know what you think.
Any update on this feature? It helps with usability
@gibahjoe I've updated my fork. You could consider using my fork/your own fork:
dependencies:
intl_phone_number_input:
git:
url: https://github.com/Siarl/intl_phone_number_input
ref: develop
Use ref: 9d6c084
for the version before I merged. I haven't tested the merge, and I know this version works fine.
I don't think this PR will be accepted anytime soon.