-
-
Notifications
You must be signed in to change notification settings - Fork 461
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
fix: tagRender should not be called when value is empty #1109
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint
src/Selector/MultipleSelector.tsxOops! Something went wrong! :( ESLint: 8.57.1 Error: Cannot read config file: /.eslintrc.js
变更概述演练此次拉取请求包含两个主要变更:在 变更
可能相关的 PR
建议的审阅者
诗歌
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1109 +/- ##
=======================================
Coverage 98.24% 98.25%
=======================================
Files 39 39
Lines 1484 1486 +2
Branches 420 442 +22
=======================================
+ Hits 1458 1460 +2
Misses 26 26 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/Selector/MultipleSelector.tsx (1)
191-194
: 代码逻辑正确,建议小幅优化!提前返回空值的处理很合理,可以避免不必要的渲染。建议添加更详细的注释说明这个优化的目的。
// https://github.com/ant-design/ant-design/issues/48930 +// 当没有选中值时提前返回null,避免不必要的渲染 if (!values.length) { return null; }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/Selector/MultipleSelector.tsx
(1 hunks)tests/Tags.test.tsx
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
tests/Tags.test.tsx (1)
326-338
: 测试用例设计合理!测试用例很好地验证了当value为空数组时不会调用tagRender函数的行为。测试覆盖了修复的核心功能。
Summary by CodeRabbit
新功能
Bug 修复
测试
这些更改改进了组件的渲染逻辑和测试覆盖率,确保在处理空值时的正确行为。