react-phone-input-2 icon indicating copy to clipboard operation
react-phone-input-2 copied to clipboard

🇻🇳 [VN] Can't enter enough digits to satisfy format

Open hypnoboutique opened this issue 2 years ago • 1 comments

You can't enter enough digits for Vietnam to satisfy the expected format.

This means I cannot enter a valid Vietnamese phone number.

Try it here: https://bl00mber.github.io/react-phone-input-2.html

The expected format is: Screenshot 2022-07-14 at 07 49 04

There may well be others, I just stumbled upon this one.

hypnoboutique avatar Jul 14 '22 07:07 hypnoboutique

While I'm down here... it would be AMAZING if the guessCountry method could be exposed for other validators to use.

eg. I'm using react-hook-form with Yup for validation. The schema is defined a few components up and I would like to use this package's methods to validate where I define the schema.

Because I can't access the guessCountry method, I'm having to hold state at my form schema level and drill an error setter through to the PhoneInput, where I can use the (unusual) onChange args - data, to be specific - to perform some basic length validation.

Sorry. Maybe I'll PR it if I get time 🤷

hypnoboutique avatar Jul 14 '22 07:07 hypnoboutique