intl_phone_number_input icon indicating copy to clipboard operation
intl_phone_number_input copied to clipboard

[FEATURE] defaultCountryCode argument

Open Siarl opened this issue 2 years ago • 2 comments

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.

Siarl avatar May 09 '22 14:05 Siarl

Any update on this feature? It helps with usability

gibahjoe avatar Apr 18 '23 09:04 gibahjoe

@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.

Siarl avatar Apr 18 '23 14:04 Siarl