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: 😢 Fix Tree showLine and showIcon missing icon #20196

Merged
merged 2 commits into from Dec 12, 2019

Conversation

afc163
Copy link
Member

@afc163 afc163 commented Dec 11, 2019

🤔 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 #20192

💡 Background and solution

Caused by #20102

image

fixed back to

image

We should use switcherIcon instead of icon to customize icon in Tree showLine mode.

📝 Changelog

Language Changelog
🇺🇸 English Fix Tree showLine and showIcon missing icon.
🇨🇳 Chinese 修复 Tree showLineshowIcon 同时开启时 [+] [-] 图标丢失的问题。

☑️ Self Check before Merge

  • 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

View rendered components/tree/demo/line.md

Copy link

@tests-checker tests-checker bot left a comment

Choose a reason for hiding this comment

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

Could you please add tests to make sure this change works as expected?

@netlify
Copy link

netlify bot commented Dec 11, 2019

Deploy preview for ant-design ready!

Built with commit 20f0749

https://deploy-preview-20196--ant-design.netlify.com

@@ -37,7 +37,7 @@ class Demo extends React.Component {
</TreeNode>
<TreeNode title="parent 1-2" key="0-0-2">
<TreeNode title="leaf" key="0-0-2-0" />
<TreeNode icon={<Icon type="form" />} title="leaf" key="0-0-2-1" />
<TreeNode switcherIcon={<Icon type="form" />} title="leaf" key="0-0-2-1" />
Copy link
Member Author

Choose a reason for hiding this comment

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

不应该用 icon 去设置 switcherIcon:#20090

@codesandbox-ci
Copy link

codesandbox-ci bot commented Dec 11, 2019

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 20f0749:

Sandbox Source
antd reproduction template Configuration

@codecov
Copy link

codecov bot commented Dec 11, 2019

Codecov Report

Merging #20196 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #20196      +/-   ##
==========================================
- Coverage   97.81%   97.81%   -0.01%     
==========================================
  Files         286      286              
  Lines        7739     7735       -4     
  Branches     2132     2164      +32     
==========================================
- Hits         7570     7566       -4     
  Misses        169      169
Impacted Files Coverage Δ
components/tree/Tree.tsx 96.66% <100%> (-0.4%) ⬇️

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 f459ae9...20f0749. Read the comment docs.

@afc163 afc163 changed the title fix: 🐛 Fix Tree showLine and showIcon missing icon fix: 😢 Fix Tree showLine and showIcon missing icon Dec 11, 2019
@@ -37,7 +37,7 @@ class Demo extends React.Component {
</TreeNode>
<TreeNode title="parent 1-2" key="0-0-2">
<TreeNode title="leaf" key="0-0-2-0" />
<TreeNode icon={<Icon type="form" />} title="leaf" key="0-0-2-1" />
<TreeNode switcherIcon={<Icon type="form" />} title="leaf" key="0-0-2-1" />
Copy link
Member

Choose a reason for hiding this comment

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

也保留一个 icon 的例子

Copy link
Member Author

Choose a reason for hiding this comment

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

image

加了个完整一点的例子。

@afc163 afc163 merged commit b02d80d into master Dec 12, 2019
@afc163 afc163 deleted the fix-tree-show-line-icon branch December 12, 2019 03:18
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.

Tree 组件 showLine 的同时 Tree 用了 icon 导致图标重叠
2 participants