You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Will result in the following mask "0) 000-0000"
It should be "(000) 000-0000"
There are a couple problems:
input_formatter.dart line 28: removeCountryCodeFromMask gets set to true even though the phone number is a national number and the inputContainsCountryCode is false.
Once removeCountryCodeFromMask is true country_data.dart line 188 will remove three characters from the beginning of the national mask therefore chopping off the area code portion of the national phone number mask.
The text was updated successfully, but these errors were encountered:
woelmer
changed the title
removeCountryCodeFromMask results in incorrect phone mask for US and national number
removeCountryCodeFromMask results in incorrect phone mask for national numbers
Nov 8, 2021
In my use case, the "country picker" is a separate dropdown / bottom sheet, so the input text field will not include the "pluscode" ("national" format; inputContainsCountryCode is false).
Since the mask is "national" (already excludes the pluscode), I believe it's redundant to trim it by taking a substring.
mockturtl
added a commit
to mockturtl/flutter_libphonenumber_platform_interface
that referenced
this issue
Sep 23, 2023
Calling this text formatter:
LibPhonenumberTextFormatter( country: usCountry, PhoneNumberFormat.national)
Will result in the following mask "0) 000-0000"
It should be "(000) 000-0000"
There are a couple problems:
input_formatter.dart line 28: removeCountryCodeFromMask gets set to true even though the phone number is a national number and the inputContainsCountryCode is false.
Once removeCountryCodeFromMask is true country_data.dart line 188 will remove three characters from the beginning of the national mask therefore chopping off the area code portion of the national phone number mask.
The text was updated successfully, but these errors were encountered: