Closed bliu13 closed 11 months ago
Hey
This function comes from libphonenumber-js
, so I think you should create an issue for this library, not mui-tel-input
.
Victor
Hi @viclafouch, I've just got around to test libphonenumber-js
directly and according to the their documentation, the library's isValidNumber()
will return false on the example US phone number I gave.
Here's the original Google implementation behavior. It looks there are other functions that could be used: isPossibleNumber()
and isPossibleShortNumber()
. Would it make sense to also re-export those in mui-tel-input
?
Hello @bliu13 !
Good point, and you're right. But, in order to avoid increasing the size of the mui-tel-input
package, I think that for a few rare cases like yours, it's better to install libphonenumber-js
in your project and import the method yourself.
This will prevent all mui-tel-input
users from seeing the package size increase for a function that is not useful.
What do you think ? :)
I've tried using the provided validation function
matchIsValidTel
and it looks like it may not be behaving correctly. When I tried to validate a US number, it seemed to be validating one number short.Correct US Number Format: +1 212 111 1111 (11 numbers) Validation Only Accepts: +1 212 111 111 (10 numbers)