Text immediately before an `<img>` sometimes fails to repaint on iOS after a screen revisit (`EnrichedText`)
Los mantenedores suelen responder en 2 días
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- ios, objective-c, react-native
- Área
- mobile
Línea de trabajo
Empieza en EnrichedTextView.mm, especialmente en renderContent, y compara el manejo de textStorage y layout con EnrichedTextInputView.mm y _performRelayout. Reproduce el problema mediante expo-router o React Navigation con react-native-screens, saliendo de la pantalla y volviendo a ella en iOS. Se considera terminado cuando el texto inmediatamente anterior a un se pinta de forma consistente en las visitas posteriores sin regresiones en el renderizado inicial.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
When EnrichedText renders HTML containing an <img>, the text on the line immediately before that image can fail to visually paint on iOS. The text is still present and correctly positioned (confirmed via the accessibility tree), but it never gets drawn. The rest of the surrounding content renders fine.
This issue is specifically correlated with revisiting a screen via React Navigation (@react-navigation/native + react-native-screens native-stack, via expo-router). A fresh first visit renders correctly, but navigating away and then back causes the line to reliably or intermittently fail to paint. This is an iOS-only issue and does not reproduce on Android.
Investigation ruled out JS-side remount timing issues (the bug persists even with zero remounts/key changes on revisit, or when forcing fixed-delay remounts).
To Reproduce
Steps to reproduce the behavior:
- In an app using
expo-routeror@react-navigation/native(withreact-native-screens), create a screen that rendersEnrichedText. - Provide HTML ending in a text block immediately followed by an
<img>, e.g.,...<div>Some text</div><img src="..." width="..." height="..." />. - Navigate to that screen. (Observe that it renders correctly).
- Navigate back to the previous screen.
- Navigate forward to the same screen again.
- See error: The line of text immediately before the
<img>is now blank (though still present and correctly positioned in the accessibility tree).
Expected behavior
The text immediately preceding the <img> tag should consistently paint and remain visible on subsequent visits to the screen, mirroring the behavior of the initial visit.
Screenshots
(Not applicable/No screenshot provided — visually, it manifests as empty space where the text should be).
Device (please complete the following information):
- Device: iPhone 17 Pro (iOS Simulator)
- OS: iOS 26.4
- Version:
react-native-enriched-htmlv1.1.1 (Running on React Native 0.86.3, Expo ~57.0.20, Fabric new architecture)
Additional context
Reproduction context: This issue could not be reproduced in isolation (e.g., via a Storybook story with identical HTML and remount behavior). It strictly depends on real React Navigation transition/view-controller behavior.
Potential contributing factor identified: In EnrichedTextView.mm, renderContent fully rebuilds textView.textStorage on every render but never explicitly invalidates/re-lays-out the NSLayoutManager around the changed content. This contrasts with the editable EnrichedTextInputView.mm, which works around similar TextKit gaps via _performRelayout. Patching EnrichedTextView to mirror this sequence did not reliably fix this specific bug on its own, but it highlights a potential TextKit gap.
Questions for maintainers:
- Is there a known interaction between
EnrichedTextView's render/layout cycle and view controller appearance/reappearance (e.g.,viewWillAppear/native view recycling) that could cause a stale/incomplete TextKit layout pass specifically on a view's second-or-later appearance in a navigation stack? - Are there any existing instrumentation or debug flags in the library for tracing
NSLayoutManagerinvalidation timing to help build a tighter reproduction?
- Lenguaje dominante
- C
- Estrellas
- 1.4k
- Forks
- 67
- Merge medio
- 3 d 22 h
- PR fusionados (30 d)
- 8
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de software-mansion/react-native-enriched-html
-
HIGH level tiptap package advisoryPosiblemente ocupada @hejsztynx la tomó hace 15 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
software-mansion/react-native-enriched-html#802 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
software-mansion/react-native-enriched-html#618 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Support for `<raw-text-block>`Abiertoenhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
software-mansion/react-native-enriched-html#803 ·
Los mantenedores suelen responder en 2 días
-
<img> wider than its rendering column fails to paint on Android — silently in isolation, with an "invalid measurement" error alongside any other text (not a decode-timing race)Posiblemente ocupada @hejsztynx la tomó hace 13 días. Abiertobug
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
software-mansion/react-native-enriched-html#797 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
[Android] Native undo restores text but silently strips inline styles, links, and list structureAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
software-mansion/react-native-enriched-html#749 ·
Los mantenedores suelen responder en 2 días
Todos los issues de software-mansion/react-native-enriched-html
Issues similares
-
chore(gateway): emit INFO budget reserved/settled logs for proactivity v2 (chip task_2855f4ec)Abiertobackend
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
BasedHardware/omi#20940 ·
Los mantenedores suelen responder en 1 día
-
Linux notifications: the default action's ' ' label shows as a blank button in xfce4-notifydAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
kovidgoyal/kitty#10625 ·
Los mantenedores suelen responder en 1 día
-
Feature Status: Needs Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
docs
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día