Skip to content

fix: set option list virtual prefix#1241

Merged
zombieJ merged 1 commit into
react-component:masterfrom
QDyanbing:select-virtual-list-prefix
Jul 10, 2026
Merged

fix: set option list virtual prefix#1241
zombieJ merged 1 commit into
react-component:masterfrom
QDyanbing:select-virtual-list-prefix

Conversation

@QDyanbing

@QDyanbing QDyanbing commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

这个改动解决什么?

为 Select 的 OptionList 中的 VirtualList 设置 prefixCls={${prefixCls}-dropdown-list},使下拉虚拟列表及滚动条生成 Select 自身前缀类名,例如 rc-select-dropdown-list-scrollbar,便于上层组件按 Select 语义样式精确覆盖。

具体改动

  • 为 OptionList 的 VirtualList 传入 dropdown list prefixCls
  • 更新相关测试断言与快照

验证

  • npm test -- tests/OptionList.test.tsx tests/Select.test.tsx tests/Accessibility.test.tsx tests/Tags.test.tsx --runInBand

Summary by CodeRabbit

  • 样式与可访问性

    • 优化虚拟下拉列表的样式标识,提升列表与滚动条状态的区分度。
    • 保持虚拟列表的 ARIA 属性行为不变,确保辅助功能支持一致。
  • 测试

    • 更新下拉列表、滚动条、RTL 模式及多选场景的相关验证,确保新样式标识和交互行为正常。

@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

@QDyanbing is attempting to deploy a commit to the React Component Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fa2e5ee5-1223-495a-968c-e74107bc6ae6

📥 Commits

Reviewing files that changed from the base of the PR and between a264f26 and 7822990.

⛔ Files ignored due to path filters (3)
  • tests/__snapshots__/OptionList.test.tsx.snap is excluded by !**/*.snap
  • tests/__snapshots__/Select.test.tsx.snap is excluded by !**/*.snap
  • tests/__snapshots__/Tags.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (4)
  • src/OptionList.tsx
  • tests/Accessibility.test.tsx
  • tests/OptionList.test.tsx
  • tests/Select.test.tsx

Walkthrough

OptionList 为虚拟下拉列表新增 ${prefixCls}-dropdown-list 前缀,并将可访问性、滚动条、RTL、字段映射及样式测试中的 DOM 选择器更新为对应类名。

Changes

下拉列表类名前缀

Layer / File(s) Summary
应用下拉列表前缀并更新测试
src/OptionList.tsx, tests/Accessibility.test.tsx, tests/OptionList.test.tsx, tests/Select.test.tsx
OptionList 将派生的 prefixCls 传递给虚拟列表,相关测试改用 rc-select-dropdown-list 及其变体选择器。

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: zombieJ

Poem

我是兔子蹦蹦跳,
新的前缀排得好。
下拉列表换新装,
测试选择不迷茫。
耳朵一竖:通过啦!

🚥 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 标题与主要变更一致,准确概括了为 OptionList 虚拟列表设置前缀的修改。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the OptionList component to pass a custom prefixCls (${prefixCls}-dropdown-list) to the underlying List component. This changes the generated class names of the dropdown list from rc-virtual-list to rc-select-dropdown-list. Corresponding test assertions and snapshots have been updated to reflect this class name change. There are no review comments, so I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.44%. Comparing base (a264f26) to head (7822990).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1241   +/-   ##
=======================================
  Coverage   99.44%   99.44%           
=======================================
  Files          31       31           
  Lines        1271     1271           
  Branches      466      466           
=======================================
  Hits         1264     1264           
  Misses          7        7           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zombieJ zombieJ merged commit 3ffd566 into react-component:master Jul 10, 2026
10 of 11 checks passed
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.

2 participants