Skip to content
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

Merged
merged 7 commits into from
Apr 21, 2020
Merged

fix: collapse default position in rtl #23445

merged 7 commits into from
Apr 21, 2020

Conversation

xrkffgg
Copy link
Member

@xrkffgg xrkffgg commented Apr 21, 2020

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

close #23444

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Fix Collapse default icon position in RTL
🇨🇳 Chinese 修复 Collapse 在 RTL 下,默认按钮位置

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

@ant-design-bot
Copy link
Contributor

ant-design-bot commented Apr 21, 2020

@codesandbox-ci
Copy link

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:

Sandbox Source
antd reproduction template Configuration

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 21, 2020

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:

Sandbox Source
antd reproduction template Configuration

@codecov
Copy link

codecov bot commented Apr 21, 2020

Codecov Report

Merging #23445 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           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           
Impacted Files Coverage Δ
components/collapse/Collapse.tsx 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 02faa4b...2bf199d. Read the comment docs.

iconPosition = expandIconPosition;
} else {
iconPosition = direction === 'rtl' ? 'right' : 'left';
}
Copy link
Member

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';
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isRTLexpandIconPosition 从 this.props 中计算,不要作为参数传递。


getIconPosition = () => {
const { expandIconPosition } = this.props;
const { direction } = React.useContext(ConfigContext);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

direction 应该只能用参数传进来。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯,已经改啦~

@afc163 afc163 merged commit 5e09660 into master Apr 21, 2020
@afc163 afc163 deleted the opt-collapse-rtl branch April 21, 2020 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Collapse icon in rtl
3 participants