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: Grid initial gutter #20762

Merged
merged 1 commit into from Jan 8, 2020
Merged

fix: Grid initial gutter #20762

merged 1 commit into from Jan 8, 2020

Conversation

afc163
Copy link
Member

@afc163 afc163 commented Jan 8, 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

💡 Background and solution

解决 next.ant.design 首屏卡片 ssr 初始化时间距为 0 的问题。

📝 Changelog

Language Changelog
🇺🇸 English
🇨🇳 Chinese 修复 Grid 响应式 gutter 在 SSR 下初始值为 0 的问题。

☑️ 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

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?

@pr-triage pr-triage bot removed the PR: unreviewed label Jan 8, 2020
@afc163 afc163 changed the title 🐛 Fix Grid initial gutter fix: Grid initial gutter Jan 8, 2020
@netlify
Copy link

netlify bot commented Jan 8, 2020

Deploy preview for ant-design ready!

Built with commit 56b4041

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

like SSR situation
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 8, 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 06fb59cb8c2e1d810c02026e5cb0c67146b9c4a1:

Sandbox Source
antd reproduction template Configuration

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 8, 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 56b4041:

Sandbox Source
antd reproduction template Configuration

@codecov
Copy link

codecov bot commented Jan 8, 2020

Codecov Report

Merging #20762 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #20762   +/-   ##
=======================================
  Coverage   97.46%   97.46%           
=======================================
  Files         296      296           
  Lines        6877     6877           
  Branches     1865     1865           
=======================================
  Hits         6703     6703           
  Misses        174      174
Impacted Files Coverage Δ
components/descriptions/index.tsx 98.92% <ø> (ø) ⬆️
components/grid/row.tsx 100% <ø> (ø) ⬆️
components/_util/responsiveObserve.ts 92.3% <100%> (ø) ⬆️

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 f3b9a16...56b4041. Read the comment docs.

@zombieJ
Copy link
Member

zombieJ commented Jan 8, 2020

ssr 下应该是 0 才对,如果 xs gutter 是 0,其他非 0。在移动端就是先大又缩回去。

@afc163
Copy link
Member Author

afc163 commented Jan 8, 2020

ssr 下应该是 0 才对,如果 xs gutter 是 0,其他非 0。在移动端就是先大又缩回去。

这就是要抉择了,要么小屏幕先大后小,或者大屏幕先小后大。

@afc163
Copy link
Member Author

afc163 commented Jan 8, 2020

现在首页跳动有点难看。或者给一个 defaultBreakpoint 的配置??

@zombieJ
Copy link
Member

zombieJ commented Jan 8, 2020

我觉得如果没有很好的方案下,不做过多干预会好些。这其实和之前 remove less loop 一样,猜一个大屏幕,但是 windows 用户其实并不一定有 Mac 的分辨率。

@afc163
Copy link
Member Author

afc163 commented Jan 8, 2020

我们至少应该在开发者给的 gutter 可能的取值中(以默认或者指定的方式)取一个作为初始值(例子中的 32 或者 40):

gutter={[
{ xs: 32, sm: 40 },
{ xs: 32, sm: 40 },
]}
,直接给 0 是 100% 跳动的。

@zombieJ zombieJ merged commit 37b61c1 into master Jan 8, 2020
@zombieJ zombieJ deleted the fix-initial-gutter branch January 8, 2020 09:14
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.

None yet

2 participants