Skip to content

feat(cascader): 添加弹出层圆角样式#7050

Open
Passing-of-A-Dream wants to merge 2 commits into
ant-design:masterfrom
Passing-of-A-Dream:fix-cascader-popup-radius
Open

feat(cascader): 添加弹出层圆角样式#7050
Passing-of-A-Dream wants to merge 2 commits into
ant-design:masterfrom
Passing-of-A-Dream:fix-cascader-popup-radius

Conversation

@Passing-of-A-Dream
Copy link
Copy Markdown
Contributor

@Passing-of-A-Dream Passing-of-A-Dream commented May 21, 2026

close #6432

Summary by CodeRabbit

  • 样式优化
    • 级联选择器弹层主体新增顶部左右圆角,与整体设计系统统一,提升视觉一致性和界面美观。
  • 界面行为
    • 弹层主体样式类已绑定,确保样式稳定应用于弹出面板,改善渲染一致性。

Review Change Stack

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. feature labels May 21, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

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: ef89b141-e765-48c1-b707-e2bca3f27d45

📥 Commits

Reviewing files that changed from the base of the PR and between 72cfa42 and 4c99575.

📒 Files selected for processing (2)
  • src/components/cascader/cascader.less
  • src/components/cascader/cascader.tsx

📝 Walkthrough

Walkthrough

为 Cascader 的底部弹层 Popup 增加了弹层主体类名绑定,并在组件样式中为该类添加顶部左右圆角(使用 CSS 变量 --adm-radius-m)。

Changes

Cascader 弹层圆角样式

Layer / File(s) Summary
Popup body 类名绑定与圆角样式
src/components/cascader/cascader.tsx, src/components/cascader/cascader.less
Popup 上新增 bodyClassName={\${classPrefix}-popup-body`},并在 LESS 中新增 .@{class-prefix-picker}-popup-body规则,为弹层主体设置border-top-left-radiusborder-top-right-radiusvar(--adm-radius-m)`。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • zombieJ

Poem

🐰
弹层轻轻跃出地平,
顶角圆润笑意盈,
Picker 握手 Cascader 盟,
细节齐整更分明,
小改动里见暖心。

🚥 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 PR标题清晰准确地概括了主要变更:为Cascader组件的弹出层添加圆角样式。
Linked Issues check ✅ Passed 代码变更完全满足关联issue #6432的需求:在Cascader弹层主体添加了圆角样式配置。
Out of Scope Changes check ✅ Passed 所有变更都在作用域内,仅涉及Cascader弹出层圆角样式的实现,没有无关修改。
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.

✨ 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.

@coderabbitai coderabbitai Bot requested a review from zombieJ May 21, 2026 06:24
Copy link
Copy Markdown
Contributor

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

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 adds rounded top corners to the Cascader component's popup body by introducing a new class and specific CSS rules. The reviewer suggests using the bodyClassName property on the Popup component instead of a general class, which would allow for more direct styling of the popup body and avoid the use of nested selectors, thereby improving maintainability.

Comment thread src/components/cascader/cascader.tsx Outdated

const popupElement = (
<Popup
className={`${classPrefix}-popup`}
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.

medium

建议使用 bodyClassName 属性来直接为弹出层的主体部分(body)设置类名。这样在编写样式时可以避免使用深层选择器去覆盖 adm-popup-body,提高样式的可维护性。

Suggested change
className={`${classPrefix}-popup`}
bodyClassName={`${classPrefix}-popup-body`}

Comment thread src/components/cascader/cascader.less Outdated
Comment on lines +40 to +45
.@{class-prefix-picker}-popup {
& .adm-popup-body {
border-top-left-radius: var(--adm-radius-m);
border-top-right-radius: var(--adm-radius-m);
}
}
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.

medium

配合 cascader.tsx 中的修改,建议直接为 bodyClassName 指定的类名编写样式,而不是通过父级类名嵌套选择。这样样式结构更清晰,也减少了对组件内部结构的依赖。

.@{class-prefix-picker}-popup-body {
  border-top-left-radius: var(--adm-radius-m);
  border-top-right-radius: var(--adm-radius-m);
}

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 21, 2026

npm i https://pkg.pr.new/antd-mobile@7050

commit: 4c99575

@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.94%. Comparing base (09966e7) to head (4c99575).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7050   +/-   ##
=======================================
  Coverage   92.94%   92.94%           
=======================================
  Files         337      337           
  Lines        7386     7386           
  Branches     1868     1879   +11     
=======================================
  Hits         6865     6865           
  Misses        485      485           
  Partials       36       36           

☔ View full report in Codecov by Sentry.
📢 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.

@coderabbitai coderabbitai Bot added size:S This PR changes 10-29 lines, ignoring generated files. lgtm This PR has been approved by a maintainer labels May 21, 2026
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. size:S This PR changes 10-29 lines, ignoring generated files. labels May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Picker 的弹层是圆角,而 Cascader 的弹层是直角

1 participant