AdelRedaa97 / react-native-select-dropdown

react-native-select-dropdown is a highly customized dropdown | select | picker | menu for react native that works for andriod and iOS platforms.
MIT License
320 stars 137 forks source link

Search functionality not showing #91

Closed sbozzella closed 1 year ago

sbozzella commented 2 years ago

Hi, i want to use dropdown menù with search functionality but it doesn't work. I mean i have enabled correctly "search" but nothing happen. This is a part of the code:

let city = ['Rome', 'New York', 'Ottawa', 'Venice', 'Paris'];
<SelectDropdown
                data = {city}
                onSelect={(selectedItem, index) => {
                  this.setState({ operatorSelected: selectedItem })
                }}
                buttonTextAfterSelection={(selectedItem, index) => {
                  return selectedItem
                }}
                rowTextForSelection={(item, index) => {
                  return item
                }}
                renderDropdownIcon={isOpened => {
                  return <FontAwesome name={isOpened ? 'chevron-up' : 'chevron-down'} color={'#004975'} size={18} />;
                }}
                search
                dropdownIconPosition={'right'}
                defaultButtonText={'Lista degli operatori'}
                buttonStyle={styles.dropdownBtnStyle}
                buttonTextStyle={styles.dropdownBtnTxtStyle}
              />

And this is the version: "react-native-select-dropdown": "^2.0.1",

This is a screen of my application: IMG_20220906_161414__01

I tried also implementing Demo 3 but also doesn't appear: IMG_20220906_170322__01

Thank you.

AdelRedaa97 commented 2 years ago

You have to add search inside component

<SelectDropdown
   search
   ....
sbozzella commented 2 years ago

Yes of course i have added search inside component but doesn't work.

`let city = ['Rome', 'New York', 'Ottawa', 'Venice', 'Paris'];
<SelectDropdown
                data = {city}
                onSelect={(selectedItem, index) => {
                  this.setState({ operatorSelected: selectedItem })
                }}
                buttonTextAfterSelection={(selectedItem, index) => {
                  return selectedItem
                }}
                rowTextForSelection={(item, index) => {
                  return item
                }}
                renderDropdownIcon={isOpened => {
                  return <FontAwesome name={isOpened ? 'chevron-up' : 'chevron-down'} color={'#004975'} size={18} />;
                }}
                search // here
                dropdownIconPosition={'right'}
                defaultButtonText={'Lista degli operatori'}
                buttonStyle={styles.dropdownBtnStyle}
                buttonTextStyle={styles.dropdownBtnTxtStyle}
              />`
AdelRedaa97 commented 2 years ago

could you try the latest version 2.0.4 and please inform me if it's still not working

sbozzella commented 2 years ago

I have installed the latest version:

package-json

but it's still not working:

Screenshot_20220907-163810_CPR_Macchine_App_Mobile

I am developing on a physical device with Android 12.

Do you have any suggestion?

Thank you.

sbozzella commented 2 years ago

i don't know how but now search function appear and works but seems that it isn't able to find data in a long list :\

AdelRedaa97 commented 1 year ago

onScrollEndReached prop is added for pagination in v3.0.0 and also onChangeSearchInputText to make your custom search function outside the component