AdelRedaa97 / react-native-select-dropdown

react-native-select-dropdown is a highly customized dropdown | select | picker | menu for react native that works for andriod and iOS platforms.
MIT License
312 stars 133 forks source link

Long list issue: scrollToIndex out of range #196

Open kashmiry opened 3 weeks ago

kashmiry commented 3 weeks ago

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"