[iOS][Fabric] Runtime Dynamic Type change leaves stale text layout: lines overflow and clip, onTextLayout reports stale widths (0.86)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Bắt đầu với reproducer rn-ios-dynamic-type-stale-text-layout được liên kết và chạy npm install && npx expo run:ios --configuration Release. Thay đổi content size của simulator trong thời gian chạy và so sánh layout cùng output của onTextLayout với một lần khởi chạy lại từ đầu, sử dụng cả hai branch plain và with-reanimated. Hoàn tất khi các thay đổi Dynamic Type trong thời gian chạy làm reflow văn bản, báo cáo độ rộng dòng hiện tại và không còn gây clip hoặc overflow.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
On iOS with the New Architecture, when the user changes the Dynamic Type size while the app is running, already-rendered <Text> keeps its stale line breaks and box heights while glyphs draw at the new scale. Lines run past the right edge of the screen and are clipped mid-glyph. onTextLayout continues to report the stale (fitting) line widths, so the app cannot even detect the overflow programmatically. Killing and relaunching the app at the same Dynamic Type size renders the identical tree correctly.
This looks like the same stale-cached-text-measurement mechanism as #45857 (fixed via #45978) and is adjacent to #45655 (no re-render on font scale change), but it still reproduces on 0.86.0.
Observations:
- Plain
<View>/<Text>trees reproduce it — no third-party code involved (mainbranch of the reproducer). - The
with-reanimatedbranch (same screen with the cards wrapped inreact-native-reanimatedAnimated.Views, mirroring the production layout where this was first observed) reproduces identically. In production this also manifested as some text "freezing" at the pre-change font scale while other text scaled — i.e. mixed text sizes on one screen. - Android is unaffected.
- Fresh mounts after a cold start are always correct; the defect only appears when the content size category changes during the app's lifetime.
- Originally observed in production on RN 0.83 (Expo SDK 55) as paragraphs of rich text drawing past the right viewport edge whenever Dynamic Type was above default; no combination of
flexShrink, explicitwidth, two-pass mount afteronLayout, or removingonPress/accessibilityRolefrom nested spans avoided it.
Steps to reproduce
npm install && npx expo run:ios --configuration Release(reproducer repo below)- Launch on an iOS simulator at the default text size — everything renders correctly (banner shows
fontScale 1.000 · 0 overflowing). - While the app is running:
xcrun simctl ui booted content_size extra-extra-large - Observe: paragraphs draw past the right content edge (marked by a red hairline) with stale line breaks; the two cards clip their text; the banner still claims
0 overflowingbecauseonTextLayoutreturns stale line widths. - Kill and relaunch the app — the identical tree renders correctly at
fontScale 1.235.
React Native Version
0.86.0
Affected Platforms
Runtime - iOS
Areas
Fabric - The New Renderer
Output of npx @react-native-community/cli info
System:
OS: macOS 26.3.1
CPU: (8) arm64 Apple M1
Memory: 355.03 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 22.20.0
path: /usr/local/bin/node
Yarn: Not Found
npm:
version: 10.9.3
path: /usr/local/bin/npm
Watchman: Not Found
Managers:
CocoaPods:
version: 1.16.2
path: /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 25.5
- iOS 26.5
- macOS 26.5
- tvOS 26.5
- visionOS 26.5
- watchOS 26.5
IDEs:
Xcode:
version: 26.6/17F113
npmPackages:
react: 19.2.0
react-native: 0.86.0
Metro: bundled (Release build, no dev server)
Stacktrace or Logs
No crash — layout-only defect. The measurement API returns false negatives:
after the runtime Dynamic Type change, text visibly overflows the container,
yet onTextLayout still reports every line as fitting inside the Yoga box
("0 overflowing" in the reproducer's banner), because the reported line
widths are the pre-change values.
Reproducer
https://github.com/v-metricsadmin/rn-ios-dynamic-type-stale-text-layout
Screenshots and Videos
| Fresh launch @ default (correct) | Runtime change to XXL (broken) | Relaunch @ XXL (correct) |
|---|---|---|
![]() |
![]() |
![]() |
Same defect on the with-reanimated branch (production-fidelity variant) — cards stop wrapping and clip after the runtime change:

- Ngôn ngữ chính
- C++
- Star
- 127k
- Fork
- 25.3k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của react/react-native
-
Needs: Author Feedback Needs: Repro
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
react/react-native#58621 · 1 bình luận ·
-
Needs: Author Feedback Needs: Repro
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
react/react-native#58610 · 1 bình luận ·
-
Needs: Triage :mag:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
react/react-native#58565 · 1 bình luận · 2 reaction ·
-
Needs: Author Feedback Needs: Repro
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
react/react-native#58555 · 5 bình luận · 2 reaction ·
-
Needs: Attention Needs: Repro
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
react/react-native#58526 · 2 bình luận ·
Tất cả issue của react/react-native
Issue tương tự
-
ai_reviewed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ydb-platform/ydb#53869 · 3 bình luận ·
-
bug cert blocker needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
project-chip/connectedhomeip#74373 ·
-
[request] tracy/0.14.1 Đang mởupstream update
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
conan-io/conan-center-index#31035 ·
-
Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
vllm-project/vllm-ascend#17329 ·


