You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
iOS: explicit line breaks expand short text to maxWidth #990
Short text separated by explicit line breaks reports the container's full available width on iOS. For example, one\ntwo in a content-sized view with a 300-point maximum width expands to 300 points even though both lines are short.
ENRMFinalizeMeasuredTextSize currently treats any second line fragment as wrapping. Explicit newlines, CRLF, and Unicode line/paragraph separators therefore trigger the same width pin as an actual soft wrap.
I propose pinning to maxWidth only when TextKit's next line starts without an explicit separator. This preserves the existing protection against rewrapping soft-wrapped content while allowing explicit breaks to retain their intrinsic width. The same helper is used by view-backed and view-free measurement.
Six native TextKit regression methods cover single-line text, explicit separators, trailing newlines, soft wrapping, soft wrapping after an explicit break, and emoji before a break. The original measurement code fails the explicit-break cases; the proposed change passes. The change was also verified in an iOS simulator through a consuming app. XCTest coverage is ready for the upstream example-app test target.
This is separate from the narrow wrapping reported in #517. The proposed fix addresses short explicit lines expanding to the full container width.
Activity