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: flex item size #517

Merged
merged 9 commits into from Aug 4, 2021
Merged

fix: flex item size #517

merged 9 commits into from Aug 4, 2021

Conversation

temper357
Copy link
Contributor

@temper357 temper357 commented Jul 19, 2021

Closes #514
Closes #500

  • 原因:issue 中渲染出错的条件是 flex box 无 height 而且有 padding,同时 flex item 的 flex-grow=1 flex-basis=0,渲染出错原因是 flex item 有 flex-grow 时需要计算 container 中的剩余空间,此时 flex-basis 为 0,而 flex container 的 size 错误使用了 minHeight(minHeight 为 vertical padding 大小),因此剩余空间大小大于 0 进入到 flex-grow 的计算流程。
  • fix: 对于 flex 主轴上无 size 的 flexbox 应该自适应 flex item 的大小,剩余空间为0, 不应该计算 flex-grow 与 flex-shrink。

answershuto
answershuto previously approved these changes Jul 20, 2021
@andycall
Copy link
Member

关联 project

@temper357 temper357 added this to In Progress in Browser Features via automation Jul 21, 2021
@temper357 temper357 added this to the 0.9 milestone Jul 21, 2021
…m-size

# Conflicts:
#	integration_tests/specs/css/css-values/rem.ts
@answershuto answershuto merged commit 684e247 into main Aug 4, 2021
Browser Features automation moved this from In Progress to Done Aug 4, 2021
@answershuto answershuto deleted the fix/flex-item-size branch August 4, 2021 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

scroll container 高度渲染错误 ScollerView 高度无法撑开父级组件
4 participants