hossein-zare / react-native-dropdown-picker

A single / multiple, categorizable, customizable, localizable and searchable item picker (drop-down) component for react native which supports both Android & iOS.
https://hossein-zare.github.io/react-native-dropdown-picker-website/
MIT License
969 stars 294 forks source link

Not scrolling on android #734

Open stereodenis opened 6 months ago

stereodenis commented 6 months ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch react-native-dropdown-picker@5.4.6 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-dropdown-picker/src/components/Picker.js b/node_modules/react-native-dropdown-picker/src/components/Picker.js
index e3fb93b..12eb5ed 100644
--- a/node_modules/react-native-dropdown-picker/src/components/Picker.js
+++ b/node_modules/react-native-dropdown-picker/src/components/Picker.js
@@ -14,16 +14,15 @@ import {
     TouchableOpacity,
     Text,
     Image,
-    FlatList,
     TextInput,
     Dimensions,
-    ScrollView,
     Modal,
     ActivityIndicator,
     BackHandler,
     Platform,
     StyleSheet,
 } from 'react-native';
+import { FlatList, ScrollView } from 'react-native-gesture-handler';

 const { height: WINDOW_HEIGHT } = Dimensions.get('window');

This issue body was partially generated by patch-package.

YASH6004 commented 5 months ago

I made the changes but it threw this error

Screenshot 2024-01-30 at 12 15 32β€―PM
themad1706 commented 5 months ago

Thx @stereodenis , I just had the same issue πŸ‘

@YASH6004 You probably need to install it https://github.com/software-mansion/react-native-gesture-handler

mark-quinn commented 3 months ago

@hossein-zare I have found an issue with Android too. I noticed the component has been updated here but in the node_modules the Picker.js file does not have the imports coming from react-native-gesture-handler.

Any idea why the version that is installed into the node modules is different?

SamuelWallisBauer commented 2 months ago

+1

MussadiqAli commented 1 month ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch react-native-dropdown-picker@5.4.6 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-dropdown-picker/src/components/Picker.js b/node_modules/react-native-dropdown-picker/src/components/Picker.js
index e3fb93b..12eb5ed 100644
--- a/node_modules/react-native-dropdown-picker/src/components/Picker.js
+++ b/node_modules/react-native-dropdown-picker/src/components/Picker.js
@@ -14,16 +14,15 @@ import {
     TouchableOpacity,
     Text,
     Image,
-    FlatList,
     TextInput,
     Dimensions,
-    ScrollView,
     Modal,
     ActivityIndicator,
     BackHandler,
     Platform,
     StyleSheet,
 } from 'react-native';
+import { FlatList, ScrollView } from 'react-native-gesture-handler';

 const { height: WINDOW_HEIGHT } = Dimensions.get('window');

This issue body was partially generated by patch-package. applied the same solution but scroll still not working in android.