hossein-zare / react-native-dropdown-picker

A single / multiple, categorizable, customizable, localizable and searchable item picker (drop-down) component for react native which supports both Android & iOS.
https://hossein-zare.github.io/react-native-dropdown-picker-website/
MIT License
969 stars 294 forks source link

search and label fields #755

Open OpenTasteSG opened 1 month ago

OpenTasteSG commented 1 month ago

I believe search and label fields always use the name field of the item.

Is there a way to customise that?

Trying to use it for country phone code list. eg. allow people to search for United States, but when use select it, I just want it to display US +1.

I know I can custom render the list item, but not sure if there is a custom render label .

OpenTasteSG commented 1 month ago

Not sure if there is an easier way, managed to achieve using below

eg. item = {name : "United States", label : "US +1", value: "US +1"} I used a under renderListItem to list, disable local search, and use make use of onChangeSearchText to search name.