danish1658 / react-native-dropdown-select-list

☝️ React Native Select List Equivalent to Html's Select with options"
https://www.npmjs.com/package/react-native-dropdown-select-list
MIT License
200 stars 89 forks source link

Bug when using search #63

Open HaythamT95 opened 1 year ago

HaythamT95 commented 1 year ago

Let's say that you have the data = [ {key:'1', value:'Apple'}, {key:'2', value:'Appliances'}, {key:'3', value:'Cameras'}, {key:'4', value:'Computers'}, {key:'5', value:'Vegetables'}, {key:'6', value:'Diary Products'}, {key:'7', value:'Drinks'}, ] ,If you enter "C" and the click on close (x) and try to use the selectlist again, you will receive only the data you searched for earlier and the not whole data. It means that I will only see ['Cameras', 'Computers'].

robertsonasc commented 1 year ago

To resolve this, you need to go in node_modules/react-native-dropdown-select-list/components/SelectList.tsx or/and MultipleSelectList.tsx and add setFilteredData(data) to the callback passed to onPress prop of the TouchableOpacity that represents the close button.

Steve-Rynjah commented 1 year ago

@robertsonasc When I try to search the drop down list drops with a list of item along with the Keyboard is open. So when I try to select the item from the drop down list at first the Keyboard dismiss and then again I have to select again on the selected option. Why can't it be done in just one step. Like onSelect the item even when the Keyboard is open it should dismiss the Keyboard and at the same time the item should be selected. Can you help me on this?

Steve-Rynjah commented 1 year ago

@danish1658 When I try to search the drop down list drops with a list of item along with the Keyboard is open. So when I try to select the item from the drop down list at first the Keyboard dismiss and then again I have to select again on the selected option. Why can't it be done in just one step. Like onSelect the item even when the Keyboard is open it should dismiss the Keyboard and at the same time the item should be selected.

vladhelios commented 7 months ago

@Steve-Rynjah Did you find a way to fix it?