-
-
Notifications
You must be signed in to change notification settings - Fork 50.5k
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: collapse default position in rtl #23445
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 2aa2939:
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 2bf199d:
|
Codecov Report
@@ Coverage Diff @@
## master #23445 +/- ##
=======================================
Coverage 98.48% 98.48%
=======================================
Files 364 364
Lines 7315 7320 +5
Branches 2004 1959 -45
=======================================
+ Hits 7204 7209 +5
Misses 111 111
Continue to review full report at Codecov.
|
components/collapse/Collapse.tsx
Outdated
iconPosition = expandIconPosition; | ||
} else { | ||
iconPosition = direction === 'rtl' ? 'right' : 'left'; | ||
} |
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.
提到一个函数里。
return expandIconPosition; | ||
} | ||
return isRTL ? 'right' : 'left'; | ||
} |
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.
isRTL
和 expandIconPosition
从 this.props 中计算,不要作为参数传递。
components/collapse/Collapse.tsx
Outdated
|
||
getIconPosition = () => { | ||
const { expandIconPosition } = this.props; | ||
const { direction } = React.useContext(ConfigContext); |
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.
direction 应该只能用参数传进来。
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.
嗯,已经改啦~
🤔 This is a ...
🔗 Related issue link
close #23444
💡 Background and solution
📝 Changelog
☑️ Self Check before Merge