Skip to content

Android: last word of short Devanagari/Gurmukhi text dropped when lineHeight is set and the Text is shrink-wrapped #60138

Open

Description

@ParminPursec

Description

On Android, a <Text> with an explicit lineHeight whose width is content-determined (e.g. alignSelf: 'flex-start' — a pill, badge or chip) can silently drop its final word when the text is Devanagari or Gurmukhi. The measured width comes out slightly narrower than what the layout needs, so the last word wraps to a second line where the box cannot grow — and vanishes. Latin text is unaffected; iOS is unaffected. Removing lineHeight renders the full string.

Steps to reproduce

<View style={{ alignSelf: 'flex-start', borderWidth: 1 }}>
  <Text style={{ fontSize: 13, lineHeight: 19 }}>छूट गया</Text>
</View>
<View style={{ alignSelf: 'flex-start', borderWidth: 1 }}>
  <Text style={{ fontSize: 13, lineHeight: 19 }}>ਛੁੱਟ ਗਿਆ</Text>
</View>

Expected: छूट गया / ਛੁੱਟ ਗਿਆ (two words each).
Actual: छूट / ਛੁੱਟ — the second word is gone. The bounding box shows trailing empty space roughly one word short.

Which exact strings trip it varies with measure rounding: on 0.86.3 we reproduced it with e.g. मुख्य पसंद → मुख्य and ऐप का उपयोग → ऐप का, while on 0.88.1 those two render fully but छूट गया / ਛੁੱਟ ਗਿਆ drop instead. That pattern is consistent with a small systematic under-measure of these scripts on the StaticLayout path (TextLayoutManager), not a glyph-specific bug.

React Native Version

0.88.1 (new architecture). Also reproduced on 0.86.3. Via Expo SDK 58, but nothing Expo-specific — the failing measure is core text layout.

Platform

Android 15 (API 35) emulator, arm64, Pixel 8 profile — and physical devices. Default system fonts (Noto Sans Devanagari / Gurmukhi).

Notes / what we tried

  • textBreakStrategy="simple" does not help (it breaks mid-word instead).
  • Bundling Noto fonts changes nothing (Android already draws these scripts with Noto).
  • Workaround we ship in production: append one trailing space to top-level Text for the affected languages — that one space of slack is enough for the measured width to fit the layout, and the full string renders. The need for exactly one space of slack again points at a small fixed under-measure.

Activity

  1. react-native-bot commented on Nov 19, 2026

    @react-native-bot
    Collaborator

    Warning

    Missing reproducer: We could not detect a reproducible example in your issue report. Reproducers are mandatory and we can accept only one of those as a valid reproducer:


    You can read more about about it on our website: How to report a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions