boyuai / antd-country-phone-input

Country phone input component as standard Ant.Design form item
https://boyuai.github.io/antd-country-phone-input/
60 stars 35 forks source link

Fix country sorting for antd area select. #67

Closed firflant closed 2 years ago

firflant commented 2 years ago

Solves #58

There are two points of this PR:

filterSort function file was not shaped correctly for the world_countries_lists package used in primary example of this library - it tried to sort by a non-existing key property, instead by name.

It was overwriting any sorting provided by areaSorter prop of a .

Because alphabetical sorting of countries in a prefix dropdown should be a default behaviour, i set a function from example to be a defaultAreaSorter.

I have not changed the implementation for a lite version, but i think it should be adjusted as well and finally, we should distinguish it between the lite and antd versions, as typing of their filtering functions is a bit different. That is why i moved filterSort function from ./shared to area-select.lite.