marmelroy / PhoneNumberKit

A Swift framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber.
MIT License
5.1k stars 810 forks source link

Enable examplePlaceholder without prefill to enable autocomplete compatibility #774

Closed johnfrancmartin closed 1 month ago

johnfrancmartin commented 3 months ago

Primary purpose is to enable examplePlaceholder and withPrefix to work with phone number autocomplete for textContentType = .telephoneNumber. iOS disables autocomplete if text is non-empty, so the current implementation is incompatible without this change.

To enable autocomplete when using withPrefix = true, withExamplePlaceholder = true, set withPrefixPrefill = false

github-actions[bot] commented 1 month ago

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

johnfrancmartin commented 1 month ago

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Not stale - still waiting to be merged.

johnfrancmartin commented 1 month ago

@bguidolim noticed you seem to have recently contributed to this repo, any chance we can get this in?

bguidolim commented 1 month ago

Hey @johnfrancmartin,

First of all, thanks for contributing.

I usually maintain this repo only to keep it updated with metadata and bug fixes. I generally avoid merging new features, especially those related to the UI. The UI part of this library tends to be quite delicate and often experiences regressions whenever new changes are merged.

I am considering eventually migrating this library to another repository where I can have more control over it. One idea I'm seriously contemplating is to remove the UI part and allow anyone interested to create a library on top of PNK.

Back to your PR, since there are not many tests for `PhoneNumberTestFields, I would generally not merge this. However, I'm going to open an exception and merge it, but please keep in mind if there is any regression report, I wouldn't invest time fixing it, I would simply revert this change.

Are you ok with it?

johnfrancmartin commented 1 month ago

Yep that's fine with me