maxkordiyak / react-native-dropdown-autocomplete

Autocomplete input with dropdown modal component for React native. Useful for pages with multiple autocomplete's.
MIT License
100 stars 51 forks source link

Scroll inside search field doesn't work #42

Open pixsolution opened 4 years ago

pixsolution commented 4 years ago

Hi! I am using your package for the next field attached capture: IMG-20191216-WA0018 I think I have a conflict with the scrolls, because inside that search field I have a scroll which does not work (only in Android because in iOS work well), and outside the search field in the view I have another scroll which does work well in both (ios and android). How can I make the scroll work within the search field in android?

My code:

<View style={baseStyles.autocompletesContainer}>
                  <SafeAreaView>
                    <Autocomplete
                      key={shortid.generate()}
                      style={baseStyles.input}
                      scrollToInput={ev => {}}
                      inputContainerStyle={baseStyles.input1}
                      inputStyle={baseStyles.input1}
                      scrollStyle={baseStyles.input2}
                      handleSelectItem={(item, index) => {
                        if (item.tipo_identificacion == 999) {
                          this.setTipoIdentificacion(item.tipo_identificacion);
                          this.setNacimiento(item.fecha_nacimiento);
                          this.setNombre(item.nombre);
                          this.setApellido(item.apellido);
                          this.setTelefono(item.celular);
                          this.setcorreo(item.email);
                        } else {
                          this.setNombre(item.nombre);
                          this.setApellido(item.apellido);
                          this.setTelefono(item.celular);
                          this.setCedula(item.cedula);
                          this.setcorreo(item.email);
                          this.setTipoIdentificacion(item.tipo_identificacion);
                          this.clickhandler();
                          this.clickhandler2();
                        }
                        console.log('item', item);
                      }}
                      onDropdownClose={() => {}}
                      onDropdownShow={() => {}}
                      minimumCharactersCount={1}
                      highlightText
                      valueExtractor={item =>
                        `${item.cedula} ${item.nombre} ${item.apellido}`
                      } //item.nombre || `${item.nombre} ${item.apellido}` || item.cedula}          //{item =>`${item.cedula}${item.nombre}${item.apellido}`}
                      rightContent
                      rightTextExtractor={item => item.properties}
                      placeholder="Por nombre o cédula"
                      fetchData={async searchTerm => {
                        //console.log(fetchData);
                        const response = await fetch(
                          this.props.loggedUser.pais +
                            `/api/buscarpacienteL?paciente=${searchTerm}${'&doctorid='}
                      ${this.props.loggedUser.user_id}`,
                        );
                        return await response.json();
                      }}
                    />
                  </SafeAreaView>
                </View>

Regards

ahmed-boussema commented 4 years ago

Just add this line below to the Flatlist in the render method of the file '<"YOUR PROJECT PATH">\node_modules\react-native-dropdown-autocomplete\components\Dropdown\index.js'

nestedScrollEnabled = {true}

image

tq-bao commented 3 years ago

It works for me. Thank you very much !

aliahmadpasa commented 3 years ago

Just add this line below to the Flatlist in the render method of the file '<"YOUR PROJECT PATH">\node_modules\react-native-dropdown-autocomplete\components\Dropdown\index.js'

nestedScrollEnabled = {true}

image

Not working at my place can you explain it in details