Skip to content

Commit 3db0095

Browse files
committed
Keep the order of only-countries alphabetically #187
1 parent d22edd3 commit 3db0095

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/components/vue-tel-input.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,8 @@ export default {
230230
filteredCountries() {
231231
// List countries after filtered
232232
if (this.onlyCountries.length) {
233-
return this.onlyCountries
234-
.map((iso) => this.allCountries.find((c) => c.iso2 === iso.toUpperCase()))
235-
.filter(Boolean);
233+
return this.allCountries
234+
.filter(({ iso2 }) => this.onlyCountries.some((c) => c.toUpperCase() === iso2));
236235
}
237236
238237
if (this.ignoredCountries.length) {

0 commit comments

Comments
 (0)