react-native-select-two icon indicating copy to clipboard operation
react-native-select-two copied to clipboard

Data only passing Id

Open YosefOberlander opened this issue 5 years ago • 4 comments

Hi,

When you select an item it only passes the Id of the object and not the name. is there away to pass the name too?

YosefOberlander avatar Apr 07 '20 12:04 YosefOberlander

I'm having the same issue.

image

subodha avatar May 10 '20 12:05 subodha

I solved problem. Copy name value to id value then use data[0] value. Because id value not necessary for me.

hasanaydemir avatar Nov 28 '20 12:11 hasanaydemir

there is a second argument you can access look at the onSelect you can see all the selected item in the console and not only the id. It's not ideal but it does the work. Although i don't see the point of displaying only the id

      <Select2
        onChange={onChange}
        selected={value || []}
        isSelectSingle
        style={{borderRadius: 5}}
        colorTheme="blue"
        popupTitle="Select item"
        title="Select item"
        listEmptyTitle="Aucun Résultat"
        data={options}
        onSelect={(data, object) => {
          console.log('data ==>', data);
          console.log('object ==>', object);
        }}
        onSelect={onChange}
        onRemoveItem={onChange}
        {...restProps}
      />
    </View>```

mehdikbj avatar Jan 27 '21 22:01 mehdikbj

@mehdikbj any Idea how to remove or reset ?

michaelVictoriaDev avatar Mar 24 '21 03:03 michaelVictoriaDev