natintosh / intl_phone_number_input

MIT License
164 stars 496 forks source link

Error: Invalid value, Input field allowing special characters #380

Open juanfactor88 opened 1 year ago

juanfactor88 commented 1 year ago

Describe the bug The international phone number input is allowing the user to enter special characters when using phone and number keyboard type. This not only doesn't look right visually but, sometimes leads to Invalid Value error when the user saves the value.

Package version 0.7.2

Flutter version 3.7.8

To Reproduce Steps to reproduce the behavior:

use the example. String initialCountry = 'US'; PhoneNumber number = PhoneNumber(isoCode: 'US'); keyboard type could be number or phone. enter 4 numbers, then enter a special character (eg: . * , ) you'll get the invalid input error.

Expected behavior You should only be able to enter numbers in the field because you're validating phone numbers.

Screenshots

image

image

Targeted platforms (please complete the following information):

Additional context There should be a way to prevent the user to input anything other than numbers.