chronotruck / FlagPhoneNumber

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

Phone number field almost impossible to select after changing country #133

Open pauloec opened 4 years ago

pauloec commented 4 years ago

Describe the bug After changing the country flag/code it is super difficult to select the phone number

To Reproduce Steps to reproduce the behavior:

  1. Go to flag/country picker
  2. Click on pick any country
  3. Try to select phone number
  4. Try tapping on phone number placeholder until it finally opens up a numberpad keyboard

Expected behavior User should be able to easily tap the field and edit

Smartphone (please complete the following information):

Sunny-Aiub commented 4 years ago

having same problem. Version 0.7.6, 0.7.7, 0.7.8 all having same issue

vids123 commented 4 years ago

I also have the same problem.Able to enter phone number but not showing cursor

grifas commented 4 years ago

Still an issue ?

karthiksaral commented 4 years ago

yes I also faced the same issue, the keyboard not change

stuartrr commented 3 years ago

It would seem the UITextField's tintColor is being set to clear somehow. So a workaround is to just set it back to it's original color when it becomes the first responder.

So for Objective-C:

-(void) textFieldDidBeginEditing:(UITextField*)textField
{
   if ( textField == _phoneNumberTextField )
   {
      _phoneNumberTextField.tintColor = _cursorColor; // where _cursorColor is the saved original color from when your view controller's view loads or something.
   }
}
JobLess-Engineer commented 2 years ago

Just put this in textFieldDidEndEditing :

    yourTextField.resignFirstResponder()
    yourTextField.inputView = nil
    yourTextField.inputAccessoryView = nil