srivastavaanurag79 / react-native-paper-select

Dropdown using React Native Paper TextInput, Checkbox and Dialog
https://anurag-srivastava.gitbook.io/react-native-paper-select/
MIT License
48 stars 15 forks source link

Hi , whenever i click on the item it will select all items in the dropdown even though i was passing multiEnable false #38

Closed shashikumarwml closed 10 months ago

shashikumarwml commented 11 months ago

<PaperSelect label="Category" value={pickerValue.selectedList} onSelection={value => { console.log('value: ', value); // setPickerValue({ // value: value.text, // error: '', // }); }} selectedArrayList={[]} arrayList={[...pickerValue.list]} multiEnable={false} selectAllEnable={false} /> the code is here

srivastavaanurag79 commented 11 months ago

Will test it and let you know if there is a bug

Peeet93 commented 10 months ago

@shashikumarwml you need to use _id as a property, otherwise it selects all

shashikumarwml commented 10 months ago

Thanks for your reply Srivasthav

Sent from Outlook for Androidhttps://aka.ms/AAb9ysg


From: Kevin Dohlen @.> Sent: Sunday, August 27, 2023 4:58:42 PM To: srivastavaanurag79/react-native-paper-select @.> Cc: Shashi Kumar @.>; Mention @.> Subject: Re: [srivastavaanurag79/react-native-paper-select] Hi , whenever i click on the item it will select all items in the dropdown even though i was passing multiEnable false (Issue #38)

@shashikumarwmlhttps://github.com/shashikumarwml you need to use _id as a property, otherwise it selects all

— Reply to this email directly, view it on GitHubhttps://github.com/srivastavaanurag79/react-native-paper-select/issues/38#issuecomment-1694642377, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A3AUGZZMBUMBVYZR673O5GDXXMVOVANCNFSM6AAAAAA2I6FDSQ. You are receiving this because you were mentioned.Message ID: @.***>

srivastavaanurag79 commented 10 months ago

Just make sure your default list which you provide must contain a unique _id for each element somewhat like this:

list: [ { _id: '1', value: 'MALE' }, { _id: '2', value: 'FEMALE' }, { _id: '3', value: 'OTHERS' }, ],

For more detail, you can check out the example.