selectCountry

fun selectCountry(newCountry: Country)(source)

Changes the country, keeping the digits the user already typed.

Digits are preserved rather than cleared: a user correcting the country after typing their number has not changed their number, and wiping it is the single most annoying behaviour a phone field can have. The number is re-formatted and re-validated for the new region, so a number that is valid in one country is never carried over as still-valid in another.