-
-
Notifications
You must be signed in to change notification settings - Fork 478
fix: https://github.com/ant-design/ant-design/issues/50642 #1084
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
💡 Codebase verification
需要补充失焦时搜索值处理的测试用例
BaseSelect 组件当前缺少针对
mergedShowSearch
条件下失焦时搜索值处理的测试用例。建议添加以下测试场景:mergedShowSearch
为 true 时,失焦应触发onSearch
并传入source: 'effect'
mergedShowSearch
为 false 时,失焦应触发onSearch
并传入source: 'blur'
现有的测试文件(BaseSelect.test.tsx)中没有相关测试覆盖,而 Select.test.tsx 中的测试用例也未验证 source 参数的正确性。
🔗 Analysis chain
搜索值处理逻辑优化
此更改合理地区分了显示搜索和非显示搜索状态下的行为,使组件在失焦时的搜索值处理更加准确。
建议执行以下脚本验证相关测试用例是否完整:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 39
Script:
Length of output: 186
Script:
Length of output: 4948
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.
合并成一个source: ? a: b如何
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.
@yoyo837,好建议!可以将代码合并成一个三元表达式,如下:
这样可以使代码更加简洁。
✏️ Learnings added