Skip to content

fix: prevent MultiSelect out of bounds crash with empty options#1613

Merged
Karanjot786 merged 1 commit into
Karanjot786:mainfrom
pradeep0153:fix/1608-multiselect-empty-bounds
Jun 21, 2026
Merged

fix: prevent MultiSelect out of bounds crash with empty options#1613
Karanjot786 merged 1 commit into
Karanjot786:mainfrom
pradeep0153:fix/1608-multiselect-empty-bounds

Conversation

@pradeep0153

Copy link
Copy Markdown
Contributor

Guards selectNext() and selectPrev() methods against iterating over an empty _options array, preventing a TypeError crash when attempting to access indices out of bounds. Resolves #1608.

@pradeep0153 pradeep0153 requested a review from Karanjot786 as a code owner June 19, 2026 04:38
@github-actions github-actions Bot added the type:bug +10 pts. Bug fix. label Jun 19, 2026
@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@pradeep0153, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 28 minutes and 12 seconds. Learn how PR review limits work.

To continue reviewing without waiting, enable usage-based billing in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7adea39e-b435-4b89-830d-cc7444237fc5

📥 Commits

Reviewing files that changed from the base of the PR and between 550e9c6 and ace6d5e.

📒 Files selected for processing (1)
  • packages/ui/src/MultiSelect.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added area:ui @termuijs/ui needs-star PR author has not starred the repo. and removed type:bug +10 pts. Bug fix. labels Jun 19, 2026
@github-actions

Copy link
Copy Markdown

Hi @pradeep0153 👋

Star this repo before your PR merges.

Why? GSSoC 2026 contributors who star get priority review and points credit. After you star, push any commit (or re-run this check). The needs-star label lifts automatically.

Thanks for your contribution to TermUI.

@Karanjot786 Karanjot786 merged commit 2f6f9e7 into Karanjot786:main Jun 21, 2026
4 of 5 checks passed
@Karanjot786 Karanjot786 added type:bug +10 pts. Bug fix. gssoc:approved Approved PR. Earns +50 base points. level:beginner +20 pts. Entry-level task. quality:clean x 1.2 multiplier. Clean implementation. labels Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ui @termuijs/ui gssoc:approved Approved PR. Earns +50 base points. level:beginner +20 pts. Entry-level task. needs-star PR author has not starred the repo. quality:clean x 1.2 multiplier. Clean implementation. type:bug +10 pts. Bug fix.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MultiSelect cursor index goes out of bounds when initialized with an empty options list

2 participants