Repository navigation
fix: keep national digits that collide with the country calling code - #365
Conversation
Accepted: ready to mergeFixes typed national numbers losing leading digits when they match the country calling code Merging stays manual here: this repository does not merge automatically. Written by a model reading the diff against |
|
Hello, when i merge a pr, the package is released, so since i merged your previous PR, the version in this one is wrong can you change pubspec and changelog |
PhoneController.changeNationalNumber always parsed the typed text with PhoneNumber.parse and the current country as destination. When the input has no '+', the parser removes a leading country calling code if the whole input is invalid but the number without that code is valid. Typing '4705555' in Norway therefore stored nsn '05555'. The text field holds a national number, so the calling code is only read as an international prefix when the digits are too long for a national number of the selected country. This keeps pasted international numbers working for example '33612345678' in France. Closes cedvdb#345
|
Good catch, thanks! Since #364 released 12.0.3, this branch now bumps If you merge #366 first instead, tell me and I will bump this one to the next patch so the release stays in order. |
f8fe0bc to
c876a85
Compare
Typing a national number whose first digits equal the selected country's calling code loses those digits.
changeNationalNumberpasses the typed text toPhoneNumber.parsewith the current country as destination. Without a+, the parser removes a leading country calling code when the whole input is invalid but the number without that code is valid.4705555becomes47+05555.+still works:33612345678in France gives612345678.0612345678in France gives612345678.mainwithnsn: 05555.Closes #345
Checks run locally:
Checklist: