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

Error scrollView App Android #731

Open Hoshiiii2602 opened 7 months ago

Hoshiiii2602 commented 7 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..91bcfa4 100644
--- a/node_modules/react-native-dropdown-picker/src/components/Picker.js
+++ b/node_modules/react-native-dropdown-picker/src/components/Picker.js
@@ -7,17 +7,17 @@ import React, {
     memo,
     Fragment,
 } from 'react';
-
+import { FlatList, ScrollView } from 'react-native-gesture-handler';
 import {
     View,
     SafeAreaView,
     TouchableOpacity,
     Text,
     Image,
-    FlatList,
+    // FlatList,
     TextInput,
     Dimensions,
-    ScrollView,
+    // ScrollView,
     Modal,
     ActivityIndicator,
     BackHandler,

This issue body was partially generated by patch-package.

Danyal255 commented 7 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..91bcfa4 100644
--- a/node_modules/react-native-dropdown-picker/src/components/Picker.js
+++ b/node_modules/react-native-dropdown-picker/src/components/Picker.js
@@ -7,17 +7,17 @@ import React, {
     memo,
     Fragment,
 } from 'react';
-
+import { FlatList, ScrollView } from 'react-native-gesture-handler';
 import {
     View,
     SafeAreaView,
     TouchableOpacity,
     Text,
     Image,
-    FlatList,
+    // FlatList,
     TextInput,
     Dimensions,
-    ScrollView,
+    // ScrollView,
     Modal,
     ActivityIndicator,
     BackHandler,

This issue body was partially generated by patch-package.

Thanks This solve my issue

stolenfallen1 commented 6 months ago

Hi, can you please explain how were you able to solve this issue? I find the solution a little vague

Danyal255 commented 6 months ago

Hi, can you please explain how were you able to solve this issue? I find the solution a little vague

a/node_modules/react-native-dropdown-picker/src/components/Picker.js in this file just change the import of FlatList and scrollview from React Native to react-native-gesture-handler

stolenfallen1 commented 6 months ago

@Danyal255 yep, I was able to look into it earlier. Thanks!

By the way, also i'll add to other users that might encounter issues after changing the import from the react-native to react-native-gesture-handler. Don't forget to wrap your app with GestureHandlerRootView.