Skip to content

Fix: scrollToIndex out of range: item length 0 but minimum is 1#253

Open
RajRohitYadav wants to merge 1 commit into
hoaphantn7604:masterfrom
RajRohitYadav:master
Open

Fix: scrollToIndex out of range: item length 0 but minimum is 1#253
RajRohitYadav wants to merge 1 commit into
hoaphantn7604:masterfrom
RajRohitYadav:master

Conversation

@RajRohitYadav
Copy link
Copy Markdown

Error:
scrollToIndex out of range: item length 0 but minimum is 1

How to reproduce?

  1. Have data of enough length such that on search, the list should scroll
  2. Select an item that is not rendered initially when the search is clicked, we have to persist this data for the next re-render
  3. On next re-render, open search, and enter string which does not exist in list

Error: 
scrollToIndex out of range: item length 0 but minimum is 1

How to reproduce?

1. Have data of enough length such that on search, the list should scroll
2. Select an item that is not rendered initially when the search is clicked, we have to persist this data for the next re-render
3. On next re-render, open search, and enter string which does not exist in list
@JDMathew
Copy link
Copy Markdown

@hoaphantn7604 would it be possible to get some of these PR's merged or open up the package to external maintainers?

gabrielroodriz added a commit to gabrielroodriz/react-native-element-dropdown that referenced this pull request May 29, 2024
@gabrielroodriz
Copy link
Copy Markdown

Is there anything else we need to finalize this?

@carlos3g
Copy link
Copy Markdown

@RajRohitYadav — landed the scrollToIndex out-of-range guard (plus a retry once the row actually mounts) in the maintained fork @carlos3g/element-dropdown starting v2.13.0. Closes #156 / #202 / #274 / #275 functionally. Drop-in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants