-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Virtualizedlist should never be nested inside scrollview #56
Comments
If you comment out the |
Nope the dropdown works just perfect. All I am facing is this warning Virtualizedlist should never be nested inside scrollview. I googled this error and there are some solutions for this. This is a common error which appears when we put a Flatlist inside Scrollview. I was not sure how to resolve that in the plugin plus I dont want to alter the node modules packages. So I thought to bring it to your notice. I am taking body measurements in my app which can be in inch/cms and pounds/kg . So I wanted to have dropdown along side each input. And all these measurements inputs are wrapped in a Scrollview container. |
Hello @cbothra , <ScrollView nestedScrollEnabled={true} />
<DropDownPicker ... />
</ScrollView> If the example doesn't solve the problem, please let me know. UpdateUpdate the package to v3.1.8. |
I also have the same warning, tried adding App.js: <ScrollView nestedScrollEnabled={true} />
<SomeComponent1 />
<SomeComponent2 />
<TheDropView />
</ScrollView> TheDropView.js: <View style={{flexDirection: 'row'}}>
<DropDownPicker ... />
</View> |
Same issue here, One way to fix is have horizontal ScrollView wrapped outside of dropdown, it will make the warning disappear, but obviously not a right solution. |
@hossein-zare Nope, just adding My case is exactly same as @usersina. @kimkong88 This hack works but yes you are are right. This is not an optimal solution. Besides that you have to give height to the scrollview so that the options gets displayed. |
I got rid of New update: 3.1.9 |
Doesn't make any difference. Warning still persists. I think its not related to flatlists or scrollview. The core problem is using scrollview/flatlist inside another scrollview/flatlist. @hossein-zare You should checkout this link for solutions: GeekyAnts/NativeBase#2947 |
Make sure you're using v3.1.9, The warning has to go away. |
Solved ! |
No, warning is there in version 3.1.9. i have installed and configured it. Also the scroll of dropdown option is not going to happen if we are using it inside scrollView or content(native base). To scroll option of dropdown inside scroll view, i need to press scroll view and then scroll is going to happen on dropdown option. Anybody have solution?? |
@hossein-zare Yep Now I can confirm that there is no more Yellow Box Warning. Btw just out of curiosity what was your solution. I hope you didn't just hide the warning :D (Just Kidding). |
I replaced |
I am facing the same issue. Getting a warning - "VirtualizedLists should never be nested inside plain ScrollViews with the same orientation because it can break windowing and other functionality - use another VirtualizedList-backed container instead." I have fixed this by using a different mode |
@codoffer |
Problem still happens in ver 5.1.17 (solved with listMode="SCROLLVIEW") |
@alessandro-bottamedi and @hossein-zare 's answers saved my time.
Reference link is here |
This configuration worked form me: <ScrollView nestedScrollEnabled={true}> // Add nestedScrollEnabled={true}
<DropDownPicker
open={open}
value={value}
items={items}
setOpen={setOpen}
setValue={setValue}
setItems={setItems}
listMode="SCROLLVIEW" // Add this line
/>
</ScrollView> |
Hi, I had the same issue, the library provides listMode props. Adding this props solved my issue.
check this documentation for more information https://hossein-zare.github.io/react-native-dropdown-picker-website/docs/next/advanced/list-modes#scrollviewprops |
the way to avoid this type of warning was mentioned in the doc , please take a look : |
this work for me |
Still not working on my end. |
@ironwebstar I won't have time to troubleshoot your project personally, however in general for anyone to help anyone you should do your best to produce a https://stackoverflow.com/help/minimal-reproducible-example |
I am not getting any error but the I have created a project over Snack. DropDown. In this project, it is working on the web but it isn't showing up on mobile, please help me out to solve this. Thank You!! |
I am also having issues, it works ok on iOS but not on android. It will open the dropdown but I can't then scroll or choose another option within the dropdown. I am using listMode="MODAL" for the time being. |
@hossein-zare do we lose any performance if we use Scroll View instead of Flat List? keep in mind the items are pretty simple text items. |
Hello @Satyam-code143 @Roundups , Unsolvable, Consider using a |
@fadinasr |
Wroks like a charm. Thanks @Pramesh98 |
This works for me. |
@hossein-zare |
I have tried your solution but i faced the error same like that |
Thanks , it solved my issue |
@hossein-zare Have you consider changing a little bit the implementation and render the dropdown inside a modal( and inside the modal the flatlist) and place it exactly under the dropdown button with the same width as the button container? I think this will solve all the compatibility problems between iOS & Android (nested scrolls etc) and the z-index bugs. |
Modals are |
Yes. The concept is that if you touch anything outside the dropdown(modal) or if you try to scroll on the parent container, then close the dropdown. |
thankyou |
this work well on IOS but android, it didn't show the list |
If I use listemode = 'SCROLLVIEW' it makes dropdown performance very slow and if I use 'FLATLIST' dropdown become not scrollable plus virtualization warning. |
I can completely relate to @umairm1alik , facing the same issue. If I use Flatlist see virtualization warning and if I use Modal, freezing issue. |
Yes, you are right. It's really feel slow and weird. |
the issue still existing with the latest version |
@Satyam-code143 Try giving height to the container of dropdown component i tried it worked for me |
Add this if you are struggling with DropDownPicker inside ScrollVide DropDownPicker.setListMode("SCROLLVIEW"); |
I am using this dropdown plugin in a scrollview and getting a following warning:
VirtualizedLists should never be nested inside plain ScrollViews with the same orientation - use another VirtualizedList - backed contained instead.
Any help would be highly appreciated.
Thank-in-advance.
The text was updated successfully, but these errors were encountered: