-
Notifications
You must be signed in to change notification settings - Fork 0
A5: <Text> always carries flexShrink: 1 on wrap-family modes #58
Copy link
Copy link
Closed
Labels
area:layoutFlexbox/Yoga/layout semanticsFlexbox/Yoga/layout semanticsarea:textText measurement, wrapping, or renderingText measurement, wrapping, or renderingbugSomething isn't workingSomething isn't workingkind:bugBehavioral bug or incorrect runtime behaviorBehavioral bug or incorrect runtime behaviorsource:real-worldSurfaced through real-world downstream usageSurfaced through real-world downstream usagesource:shakedownImported from the local Yokai shakedown issue listImported from the local Yokai shakedown issue list
Description
Metadata
Metadata
Assignees
Labels
area:layoutFlexbox/Yoga/layout semanticsFlexbox/Yoga/layout semanticsarea:textText measurement, wrapping, or renderingText measurement, wrapping, or renderingbugSomething isn't workingSomething isn't workingkind:bugBehavioral bug or incorrect runtime behaviorBehavioral bug or incorrect runtime behaviorsource:real-worldSurfaced through real-world downstream usageSurfaced through real-world downstream usagesource:shakedownImported from the local Yokai shakedown issue listImported from the local Yokai shakedown issue list
Imported from the local Yokai shakedown tracker as A5.
Project metadata: category=A: Core API, effort=0 (subsumed), impact=unknown, risk=unknown, when=with A1.
Status: OPEN (related to A1; the fix landed for truncate modes was reverted)
Where:
Text.tsx memoizedStylesForWrap—'wrap'and'wrap-trim'modes setflexShrink: 1Symptom: Nested Text inside a column-flex parent containing larger siblings → yoga shrinks the wrapping Text. Its content wraps to a 2nd line that's invisible because of
height: 1on the parent. Looks identical to fixed-position truncation, but silent.Common manifestation: title bar fights with file list — title bar's text gets shrunk by yoga to make room for the file list's natural width, title text wraps to invisible 2nd line.
Workaround: put the title in a
<Box flexShrink={0}>wrapper, OR use explicitwidthon the title's container (subject to A1 caveats — the wrapper might still allow basis to be wrong).Proper fix: wrap-mode Text shouldn't make itself shrink-eligible by default. Wrap-when-necessary should kick in only when yoga has actually committed less width than natural during the EXACTLY pass — not preemptively make the Text a flex-shrink victim during the AtMost basis pass.
This is the same root issue as A1 —
measureTextNodereporting wrapped/truncated dimensions during intrinsic measurement gets baked in as basis, andflexShrink: 1then locks the wrong basis. Fix A1 properly and A5 mostly evaporates.Effort: dependent on A1. If A1 is fixed at the measure layer, A5's
flexShrink: 1becomes safe to keep (basis is now natural; flex math distributes correctly).B. Layout footguns
These are documentable gotchas more than bugs — yoga / CSS-flex semantics that are correct per spec but trip TUI-context expectations.