-
-
Notifications
You must be signed in to change notification settings - Fork 478
fix: Fix search props leaked to DOM #1157
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
""" Walkthrough本次变更扩展了 Changes
Suggested reviewers
Possibly related PRs
Poem
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/Select.tsxOops! Something went wrong! :( ESLint: 8.57.1 Error: Cannot read config file: /.eslintrc.js
src/hooks/useSearchConfig.tsOops! Something went wrong! :( ESLint: 8.57.1 Error: Cannot read config file: /.eslintrc.js
✨ Finishing Touches
🧪 Generate 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 #1157 +/- ##
=======================================
Coverage 98.11% 98.11%
=======================================
Files 39 39
Lines 1482 1483 +1
Branches 421 449 +28
=======================================
+ Hits 1454 1455 +1
Misses 28 28 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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/Select.tsx (1)
61-68
: 考虑同步遗漏的搜索相关属性,避免后续再出现 DOM 警告此次补充的属性可以有效阻断过滤相关配置泄漏到原生元素,但目前
SearchConfig
中仍有searchValue
、autoClearSearchValue
、onSearch
等字段同样会通过restProps
透传,理论上也可能成为未知 DOM 属性并触发 React 警告。建议一并加入到OMIT_DOM_PROPS
,或在BaseSelect
内部集中维护完整白名单,减少未来遗漏的概率。可选修改示例:
const OMIT_DOM_PROPS = [ 'inputValue', + 'onSearch', + 'searchValue', + 'autoClearSearchValue', 'filterOption', 'optionFilterProp', 'filterSort', 'filterTreeNode', 'treeNodeFilterProp', ];如无特殊理由排除上述字段,请补充后再运行一轮 CI,确保没有新的 “unknown prop” 报错。
修复部分search配置透出到dom上的报错
Summary by CodeRabbit