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(Layout): disable hasSider when specifically declared #15396

Merged
merged 1 commit into from Mar 14, 2019

Conversation

@SoraYama
Copy link
Contributor

@SoraYama SoraYama commented Mar 14, 2019

First of all, thank you for your contribution! 😄

New feature please send pull request to feature branch, and rest to master branch.
Pull request will be merged after one of collaborators approve.
Please makes sure that these form are filled before submitting your pull request, thank you!

[中文版模板 / Chinese template]

🤔 This is a ...

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

👻 What's the background?

  1. Describe the source of requirement, like related issue link.

Just find a bug (probably) when coding

  1. Describe the problem and the scenario.

In some situation Sider is deeply rendered in Children of Layout,
and if we don't want to judge whether Layout has sider, the attr hasSider
set to false should properly work. However hasSider || this.state.siders.length > 0
will ignore hasSider when it is false.

💡 Solution

  1. How to fix the problem, and list final API implementation and usage sample if that is an new feature.

Judge hasSider is type of Boolean first.

  1. GIF or snapshot should be provided if includes UI/interactive modification.

📝 Changelog description

Describe changes from userside, and list all potential break changes or other risks.

  1. English description

Fix a bug: Layout has classname ant-layout-has-sider even if hasFixer is set to false when sider is one of its descendants.

  1. Chinese description (optional)

修复即使在指定 Layout 的 hasSider 属性为 false 的时候依然会加 ant-layout-has-sider 的 classname 的问题

☑️ 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
In some situation `Sider` is deeply rendered in Children of `Layout`,
and if we don't want to judge whether `Layout` has sider, the attr `hasSider`
set to `false` should properly work. However `hasSider || this.state.siders.length > 0`
will ignore `hasSider` when it is `false`.
@netlify
Copy link

@netlify netlify bot commented Mar 14, 2019

Deploy preview for ant-design ready!

Built with commit 2b7fce3

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

1 similar comment
@netlify
Copy link

@netlify netlify bot commented Mar 14, 2019

Deploy preview for ant-design ready!

Built with commit 2b7fce3

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

@codecov
Copy link

@codecov codecov bot commented Mar 14, 2019

Codecov Report

Merging #15396 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15396      +/-   ##
==========================================
+ Coverage   94.23%   94.26%   +0.03%     
==========================================
  Files         250      250              
  Lines        6645     6645              
  Branches     1943     1929      -14     
==========================================
+ Hits         6262     6264       +2     
+ Misses        382      380       -2     
  Partials        1        1
Impacted Files Coverage Δ
components/layout/layout.tsx 90.62% <100%> (ø) ⬆️
components/upload/UploadList.tsx 96.33% <0%> (+1.83%) ⬆️

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 98b10a7...2b7fce3. Read the comment docs.

@afc163 afc163 merged commit 4f0e6e6 into ant-design:master Mar 14, 2019
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants