diff --git a/projects/ngx-intl-tel-input/src/lib/ngx-intl-tel-input.component.ts b/projects/ngx-intl-tel-input/src/lib/ngx-intl-tel-input.component.ts index 069fa536..a9c5ed39 100644 --- a/projects/ngx-intl-tel-input/src/lib/ngx-intl-tel-input.component.ts +++ b/projects/ngx-intl-tel-input/src/lib/ngx-intl-tel-input.component.ts @@ -230,7 +230,7 @@ export class NgxIntlTelInputComponent implements OnInit, OnChanges { : this.selectedCountry.iso2; if (countryCode && countryCode !== this.selectedCountry.iso2) { const newCountry = this.allCountries - .sort((a, b) => { + .slice().sort((a, b) => { return a.priority - b.priority; }) .find((c) => c.iso2 === countryCode);