onmotion / react-native-autocomplete-dropdown

Dropdown Item picker with search and autocomplete (typeahead) functionality for react native
MIT License
191 stars 76 forks source link

Component from the example isn't scrollable on Android #79

Open mirco123 opened 1 year ago

mirco123 commented 1 year ago

The following code works fine under iOS, it also displays correctly on Android but the suggestion list is not scrollable. Btw. this is the example from the official documentation only enhanced by more data and it is not working as expected. Can anyone help?

`import { AutocompleteDropdown } from 'react-native-autocomplete-dropdown'; . . .

return (

        <AutocompleteDropdown
            clearOnFocus={false}
            closeOnBlur={true}
            closeOnSubmit={false}
            initialValue={{ id: '2' }} // or just '2'
            onSelectItem={( item ) => item && setSelectedItem( item.id )}
            dataSet={[
                { id: '1', title: 'Alpha' },
                { id: '2', title: 'Beta' },
                { id: '3', title: 'Gamma' },
                { id: '4', title: 'Delta' },
                { id: '5', title: 'Epsilon' },
                { id: '6', title: 'Zeta' },
                { id: '7', title: 'Eta' },
            ]}
        />
</View>);`
longtm101898 commented 1 year ago

I've same issue

salokod commented 1 year ago

Same issue here

Thyago331 commented 1 year ago

Same issue here react-native-autocomplete-dropdown": "^2.1.0",

Thyago331 commented 1 year ago

Same issue here react-native-autocomplete-dropdown": "^2.1.0",

this problem started for me when i updated all my packeges, so i tested all and using the react-native@0.71 or higher the problem appears, so by using react-native@0.70.9(latest stable version) it work fine

onmotion commented 1 year ago

Same issue here react-native-autocomplete-dropdown": "^2.1.0",

this problem started for me when i updated all my packeges, so i tested all and using the react-native@0.71 or higher the problem appears, so by using react-native@0.70.9(latest stable version) it work fine

Good catch, thanks. I'll take a look once I'm done with my business

salokod commented 1 year ago

I downgraded to react-native@0.70.9 and it didn't work for me

Villar74 commented 1 year ago

Got fixed by wrapping App.tsx with GestureHandlerRootView

import { GestureHandlerRootView } from 'react-native-gesture-handler';

return (
  <GestureHandlerRootView style={{ flex: 1 }}>
      ...
  </GestureHandlerRootView>)

And changed Flatlist import in node_modules/react-native-autocomplete-dropdown/src/Dropdown.js from import { FlatList } from 'react-native'; to import { FlatList } from 'react-native-gesture-handler';

so patch file patches/react-native-autocomplete-dropdown+2.1.1.patch look like this:

diff --git a/node_modules/react-native-autocomplete-dropdown/src/Dropdown.js b/node_modules/react-native-autocomplete-dropdown/src/Dropdown.js
index 003dc6d..9ae27b5 100644
--- a/node_modules/react-native-autocomplete-dropdown/src/Dropdown.js
+++ b/node_modules/react-native-autocomplete-dropdown/src/Dropdown.js
@@ -1,5 +1,6 @@
 import React, { memo, useMemo } from 'react'
-import { StyleSheet, FlatList, View, Keyboard } from 'react-native'
+import { StyleSheet, View, Keyboard } from 'react-native'
+import { FlatList } from 'react-native-gesture-handler';

 export const Dropdown = memo(
   ({
onmotion commented 1 year ago

please try install v3. It requires additional steps, please read updated docs

Villar74 commented 1 year ago

please try install v3. It requires additional steps, please read updated docs

@onmotion you forgot to update examples ^_^

v3 is working fine, gj!

onmotion commented 1 year ago

please try install v3. It requires additional steps, please read updated docs

@onmotion you forgot to update examples ^_^

What's wrong with examples?

Villar74 commented 1 year ago

please try install v3. It requires additional steps, please read updated docs

@onmotion you forgot to update examples ^_^

What's wrong with examples?

@onmotion There are still vector icons usage in example with fetch

onmotion commented 1 year ago

Sorry, can't see, please send me a link

Villar74 commented 1 year ago

@onmotion https://github.com/onmotion/react-native-autocomplete-dropdown#example-with-remote-requested-dataset

onmotion commented 1 year ago

aah in the readme, damn. Thanks