material-ui-phone-number icon indicating copy to clipboard operation
material-ui-phone-number copied to clipboard

Morocco phone pattern is wrong

Open geiszla opened this issue 2 years ago • 4 comments

The pattern given for Morocco is +212-......... (notice that the phone code is already in the pattern, while in, e.g. UK pattern, it is given as +.. .... ...... without the phone code). This will make formatNumber return the wrong phone number (e.g. +212-212 when only entering +212) and therefore will make inputting certain phone numbers impossible.

The fix is simply to remove the numbers from the pattern (change it to +...-.........).

geiszla avatar Mar 16 '22 10:03 geiszla

@geiszla Thanks for this, I had created a fork to work on this then I saw you had a fix already 😄

v1b3m avatar Jul 13 '22 12:07 v1b3m

Quick question @geiszla Did you have to install the peerDependencies before building the package again? If not, what steps did you follow?

v1b3m avatar Jul 13 '22 13:07 v1b3m

Quick question @geiszla Did you have to install the peerDependencies before building the package again? If not, what steps did you follow?

Tbh because this was just a string change, I search and replaced every occurrence, didn't build again 😅. However, we are not using this fix, as this PR didn't get any reaction (and just overall this package is not maintained anymore), we switched to react-phone-number-input.

geiszla avatar Jul 13 '22 13:07 geiszla

Tbh because this was just a string change, I search and replaced every occurrence, didn't build again 😅. However, we are not using this fix, as this PR didn't get any reaction (and just overall this package is not maintained anymore), we switched to react-phone-number-input.

@geiszla Totally makes sense, building this is another hustle 😅 . Thanks for the update

v1b3m avatar Jul 15 '22 05:07 v1b3m