material-ui-phone-number
material-ui-phone-number copied to clipboard
Morocco phone pattern is wrong
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 Thanks for this, I had created a fork to work on this then I saw you had a fix already 😄
Quick question @geiszla Did you have to install the peerDependencies
before building the package again? If not, what steps did you follow?
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
.
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