Skip to content

Fix stuck selection when initialIndex is larger than limit #44

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

Merged

Conversation

waterUnderTheFridge01
Copy link
Contributor

@waterUnderTheFridge01 waterUnderTheFridge01 commented Jul 13, 2022

Fixes #43

selected index would sometimes be greater than the items array length. If initialIndex is ever greater than array length we rotate the array and set the index to the max.

Ran prettier. I appreciate the work on this project.

(I didn't see anything on the contributing.md file on bumping the version so leaving that as is.)

@vadimdemedes
Copy link
Owner

Thanks for the fix 👍

@vadimdemedes vadimdemedes changed the title Bug: initial index was sometimes greater than the array length Fix stuck selection when initialIndex is larger than limit Mar 1, 2023
@vadimdemedes vadimdemedes merged commit 5cdf4d9 into vadimdemedes:master Mar 1, 2023
dnnsmnstrr added a commit to dnnsmnstrr/ink-select-input that referenced this pull request Mar 4, 2023
* upstream/master:
  5.0.0
  Migrate to ESM and Ink 4 (vadimdemedes#46)
  4.2.2
  Refresh dependencies
  Fix stuck selection when `initialIndex` is larger than `limit` (vadimdemedes#44)
  4.2.1
  Update peer dependencies to allow React 17.x (vadimdemedes#37)
  Fix old version link in readme
  4.2.0
  Reset selected item only when list values change (vadimdemedes#33)
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.

initialIndex is not working with limit
2 participants