Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using defaultRegion resets the country code on every focus #53

Closed
Zmetser opened this issue Apr 27, 2022 · 5 comments
Closed

Using defaultRegion resets the country code on every focus #53

Zmetser opened this issue Apr 27, 2022 · 5 comments

Comments

@Zmetser
Copy link

Zmetser commented Apr 27, 2022

Description

When using defaultRegion with a selectable country code flag, the country code resets back to the default every time the text field is focused.

It should keep the selected country code and not reset back to the default.

Repro

iOS 15.0.4
iPhoneNumberField 0.6.1

  1. Select a country code other than the default
  2. Tap in the text field
  3. => The country code resets back to the default

Code

iPhoneNumberField(nil, text: $text)
                .defaultRegion(Locale.current.regionCode)
                .flagHidden(false)
                .flagSelectable(true)
@bereydev
Copy link

bereydev commented May 9, 2022

Same issue here did you find any workaround ?

@Zmetser
Copy link
Author

Zmetser commented Jul 7, 2022

@bereydev No, I'm using it like this, and living with the issues it has and postponing having to deal with it.

iPhoneNumberField(nil, text: $phoneNumberFormatted, isEditing: $fieldFocus)
                .flagHidden(false)
                .flagSelectable(true)
                .prefixHidden(false)
                .autofillPrefix(true)

@MojtabaHs
Copy link
Owner

MojtabaHs commented Aug 8, 2022

Fixed in v0.10.0

@X901
Copy link

X901 commented Oct 2, 2022

@MojtabaHs Still doesn't fix on 0.10.0 !

@bereydev
Copy link

bereydev commented Oct 2, 2022

@MojtabaHs First thank you for putting time an effort into making this library publicly available. We are a small team of iOS developers and really like this project. It could be really useful for lot of other developer if it was maintained more actively! I would like to help your and support your project by contributing to this if you are up to put us a main contributors to the project we could really make it ready for new version of iOS and even more versatile as it is already. Please feel free to check our website https://bereyziat.dev or contact me directly on bereyziat.developer@gmail.com we could have a little call as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants