chronotruck / FlagPhoneNumber

A formatted phone number UITextField with country flag picker.
Apache License 2.0
437 stars 318 forks source link

getFormattedPhoneNumber returns invalid phone string #116

Open mgray88 opened 5 years ago

mgray88 commented 5 years ago

Describe the bug getFormattedPhoneNumber returns an invalid phone string

To Reproduce Steps to reproduce the behavior:

  1. Call set(phoneNumber:) with a valid phone string
  2. Use the keyboard to delete all text from the text field
  3. getFormattedPhoneNumber(format: .E164) returns "+(null)(null)"

Expected behavior Expect getFormattedPhoneNumber to return null if the phone number is invalid

Smartphone (please complete the following information):

FlagPhoneNumber (please complete the following information):

mgray88 commented 5 years ago

Actually, set(phoneNumber:) isn't even required, getFormattedPhoneNumber returns the invalid string regardless