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

Long list issue: scrollToIndex out of range

Open kashmiry opened this issue 1 year ago • 3 comments

Hello, Thank you for this package.

There an error that happens when I have a long list, like countries and there is a selected value down in the list. The error get thrown in these cases:

  1. When a user types something in the search bar it will throw: ERROR Invariant Violation: scrollToIndex out of range: item length 0 but minimum is 1
  2. If I closed the select before it finished scrolling to selected value. ERROR TypeError: Cannot read property 'scrollToIndex' of null

https://github.com/AdelRedaa97/react-native-select-dropdown/assets/4423561/f416f71e-3592-462b-907a-3c0a33bfc26d

"react-native": "0.73.8",
"react-native-select-dropdown": "^4.0.1"

kashmiry avatar Jun 16 '24 06:06 kashmiry

Same here. I am using "react-native": "0.73.7" and "react-native-select-dropdown": "^4.0.1". You can do a workaround by adding the disableAutoScroll property, hopefully we can have a fix soon.

nivohayonDEV avatar Jul 31 '24 08:07 nivohayonDEV

Same here :( image If i close the modal quickly it does this

MarekGarda avatar Nov 13 '24 19:11 MarekGarda

I have the same issue. Is there a way to wrap this functionality in a try/catch?

MarkoCubicAgilno avatar Apr 30 '25 11:04 MarkoCubicAgilno