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
refactor: Select deprecated showArrow prop #43520
Conversation
Run & review this pull request in StackBlitz Codeflow. |
Updated and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: rc-select@14.5.2, rc-tree-select@5.9.0 |
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## feature #43520 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 657 658 +1
Lines 11077 11091 +14
Branches 2998 2998
=========================================
+ Hits 11077 11091 +14
☔ View full report in Codecov by Sentry. |
components/select/index.tsx
Outdated
@@ -131,7 +136,7 @@ const InternalSelect = < | |||
}, [props.mode]); | |||
|
|||
const isMultiple = mode === 'multiple' || mode === 'tags'; | |||
const mergedShowArrow = useShowArrow(showArrow); | |||
const showSuffixIcon = useShowArrow(props.suffixIcon); |
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.
要兼容 showArrow
,留个 test case 保证废弃的 api 也有效
components/select/index.tsx
Outdated
@@ -221,6 +227,12 @@ const InternalSelect = < | |||
'Select', | |||
'`dropdownMatchSelectWidth` is deprecated. Please use `popupMatchSelectWidth` instead.', | |||
); | |||
|
|||
warning( | |||
showArrow === undefined, |
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.
showArrow === undefined, | |
!('showArrow' in props), |
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
📝 Changelog
Select
&Tree-Select
&Cascader
component deprecatedshowArrow
propSelect
&Tree-Select
&Cascader
组件废弃showArrow
属性☑️ Self-Check before Merge
🚀 Summary
🤖 Generated by Copilot at c983312
This pull request refactors the
Select
component to use thesuffixIcon
prop instead of theshowArrow
andinputIcon
props. This simplifies the API and allows more customization of the select appearance. It also updates the demos and the documentation to reflect the new prop name and default value.🔍 Walkthrough
🤖 Generated by Copilot at c983312
showArrow
prop and replace it withsuffixIcon
prop inSelect
component and related components (link, link, link, link, link, link, link, link, link, link, link, link, link)showArrow
prop fromSelect
component incustom-tag-render
demo and update documentation to reflect default value ofsuffixIcon
prop (link, link, link)showArrow
prop inInternalSelectProps
interface incomponents/select/index.tsx
(link)mergedShowArrow
variable toshowSuffixIcon
and changeuseShowArrow
hook to acceptsuffixIcon
prop inInternalSelect
value or function incomponents/select/index.tsx
(link)showArrow
prop withshowSuffixIcon
prop inuseSelect
hook call andRcSelect
component call inInternalSelect
value or function incomponents/select/index.tsx
(link, link, link)useShowArrow
hook logic to returntrue
ifsuffixIcon
prop is notnull
incomponents/select/useShowArrow.ts
(link)showArrow
prop toshowSuffixIcon
prop and replace it withshowSuffixIcon
prop ingetSuffixIconNode
function call iniconUtil
function incomponents/select/utils/iconUtil.tsx
(link, link, link)inputIcon
prop fromSelectProps
interface andRcSelect
component call incomponents/select/index.tsx
(link, link)showArrow
prop withsuffixIcon
prop set tonull
to hide arrow icon inSelect
component insearch-box
demo (link)