Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[0.88] Fix Android crash drawing text decorations in numberOfLines-truncated Text

Open Beginner friendly
#1,456 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
android, kotlin, react-native
Domain
mobile

Research direction

Read the two linked commits in order, focusing on TextDecorationStyle.kt and TextDecorationStyleTest. Reproduce the crash with Android text decorations inside a numberOfLines-truncated Text, then run the focused tests. Done when the crash is fixed, partially visible decoration reaches the ellipsis, and empty or fully hidden ranges are covered.

Written by the indexing model from the issue text.

Description

Type Pick Request
Target Branch

0.88

Link to commit or PR to be picked

https://github.com/react/react-native/commit/ca8504b1caa9f79152cc14fcc6c0d7e46ada2633 and https://github.com/react/react-native/commit/dbd5b3b770039b86cf8c538cb52eb860717d0e88

Description

Picks #58366 (merged to main as ca8504b) and its follow-up #59050 (merged as dbd5b3b). Together they fix a crash in Android text decoration drawing, which is new in 0.88 (#56768).

Problem: Since 0.88, Android draws underline and line-through itself (ReactUnderlineSpan / ReactStrikethroughSpan → drawSpannedDecoration). It passes the span's offsets from the full text to Layout.getPrimaryHorizontal(). When numberOfLines truncates the text before the decorated span ends, this throws IndexOutOfBoundsException: offset(N) should be less than line limit(M) from onDraw and the app crashes. 0.87 doesn't crash here, because the platform UnderlineSpan handled truncation.

Impact: We hit this in our production app right after moving to 0.88.0 (Expo SDK 58). Café descriptions are collapsed with numberOfLines={3}, and glossary terms inside them are nested Text with textDecorationLine: 'underline'. A screen whose underlined term sat past the third line crashed as soon as it opened, and collapsing an expanded description crashed too. Any app with an underlined or struck-through nested Text inside a truncated Text can hit this, and the result is a crash, not a rendering glitch.

Risk: Low. Both commits only change TextDecorationStyle.kt (clamp the offsets to the last position the truncated, possibly ellipsized layout can resolve; skip empty and fully hidden ranges) and add tests to TextDecorationStyleTest. Applied in order, they apply cleanly to 0.88-stable. We're carrying them as a local patch on 0.88.0 for now, which means building React Native from source on Android, since the prebuilt react-android can't be patched. With the patch the crash no longer reproduces on an Android emulator, and partially visible terms are underlined up to the ellipsis.

Dominant language
No language data
Stars
429
Forks
11
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from reactwg/react-native-releases

All issues in reactwg/react-native-releases

Similar issues

More Mobile Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.