Skip to content

Conversation

@L1yp
Copy link

@L1yp L1yp commented Jan 20, 2026

close #438

Summary by CodeRabbit

  • Bug Fixes
    • Improved auto-scroll behavior to only activate when lists contain multiple items, preventing unnecessary scrolling when lists are empty or contain a single item.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

📝 Walkthrough

Walkthrough

The watcher on props.list.length in the BubbleList component is now conditioned to trigger only when the list length exceeds 1, preventing auto-scroll invocation for lists with 0 or 1 items. This avoids an error in the autoScroll() function when attempting to access the second-to-last element of a single-item list.

Changes

Cohort / File(s) Summary
BubbleList watcher fix
packages/core/src/components/BubbleList/index.vue
Changed list-length watcher condition from > 0 to > 1 to prevent auto-scroll errors when list contains only one item

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested reviewers

  • HeJiaYue520
  • WengJianFei

Poem

🐰 A bubble list once tripped on its feet,
When single items caused scroll to repeat,
Now the watcher stands guard, wise and keen,
Only scrolling where two bubbles are seen! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the fix: addressing undefined error when BubbleList length becomes 1, which matches the watcher change preventing autoScroll calls when list has fewer than 2 items.
Linked Issues check ✅ Passed The PR correctly implements the required fix by changing the watcher condition from length > 0 to length > 1, preventing autoScroll execution when insufficient items exist to safely access the second-last item.
Out of Scope Changes check ✅ Passed The change is narrowly scoped: only the watcher condition in BubbleList is modified to fix the identified issue, with no unrelated alterations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

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.

[BubbleList] 清空后新增一行会报错

1 participant