react-native-dropdown-picker icon indicating copy to clipboard operation
react-native-dropdown-picker copied to clipboard

Weird behaviour when more than 65 items in the dropdown

Open lbrianza opened this issue 4 years ago • 3 comments

Hi, I have the following issue:

I have a dropdown picker that works perfectly fine until the number of items is less than 65. However, if I have more than 65 items, when scrolling down the list something strange occurs and some blank space appears at the end of the list.

Here a snack reproducing the problem: Link

If you open the dropdown menu and scroll down till the end, you will notice the last item disappearing and then blank space appears.

If you remove from the code the last 6 items of the dropdown, instead, the problem disappears.

lbrianza avatar Jun 06 '21 12:06 lbrianza

Hello,

This mostly likely happens because you have a large number of items and each of them contain some complicated logic (RenderListItem.js) so that the app can't handle the process.

Please test it on a real device.

hossein-zare avatar Jun 06 '21 18:06 hossein-zare

Hello,

What do you mean by "contain some complicated logic"?

I tested it also on real device (2 different ones, android and iphone) and the same problem occurs... so there is no way to have more than 65 items in the list?

lbrianza avatar Jun 06 '21 21:06 lbrianza

The RenderListItem.js file handles too many updates sometimes it can't render your items that's why the blank space appears instead of items.

You can create your own RenderListItem component and keep it as simple as possible: https://hossein-zare.github.io/react-native-dropdown-picker-website/docs/advanced/list-and-items#renderlistitem

I will also try to improve the behavior of the component.

hossein-zare avatar Jun 06 '21 21:06 hossein-zare