fix(Cell): 按 value 是否为空区分 flex,空 value 不占位、有内容时撑满#1006
Merged
Pilotager merged 3 commits intomallfoundry:mainfrom Mar 10, 2026
Merged
fix(Cell): 按 value 是否为空区分 flex,空 value 不占位、有内容时撑满#1006Pilotager merged 3 commits intomallfoundry:mainfrom
Pilotager merged 3 commits intomallfoundry:mainfrom
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1006 +/- ##
=======================================
Coverage ? 56.78%
=======================================
Files ? 57
Lines ? 965
Branches ? 285
=======================================
Hits ? 548
Misses ? 410
Partials ? 7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联
问题
#968 将
taroify-cell__value改为flex: 0 0 auto后,导致「仅 value、无 title」的 Cell(如表单输入)无法撑满宽度。#1004 通过仅在--alone上设flex: 1缓解,但依赖「是否有 title」而非「value 是否有内容」,Field 等有 label 的场景仍可能不撑满。方案
按 value 是否为空 区分:
flex: 1,撑满剩余空间(无论是否 alone)。--emptyclass,flex: 0 0 auto,不占位,brief 可撑满。改动
&__value { flex: 1; },新增&__value--empty { flex: 0 0 auto; }。React.Children.count(children) === 0为 value 节点添加cell__value--empty;并修正渲染时把children传入 View(此前从 props 解构后未传入)。