Skip to content

Android: pasted text in multiline TextInput ignores lineHeight for one frame, then jumps #60207

Open

Description

@karroge10

Description

On Android, text that is pasted into a multiline TextInput with lineHeight is drawn for one frame with the default line spacing, then jumps to the requested lineHeight. With ruled lines behind the input (a notebook look) the text visibly snaps by several lines on every paste. Typing is not affected.

From reading ReactEditText.kt, CustomLineHeightSpan is only added in addSpansFromStyleAttributes, which runs when text is set from JS or for measurement. Text inserted natively (paste, autofill) into an empty field has no span to inherit, so it is laid out without the line height until the controlled value round-trips through JS and the spans are rebuilt. Re-applying the line-height span in TextWatcherDelegator.afterTextChanged when it no longer covers the whole text would avoid the frame.

Related: #46813 (multiline height updates a frame after content). That one is about layout height; this one is the line spacing of the text itself.

Steps to reproduce

  1. Run the reproducer below on Android (emulator or device).
  2. Copy three or four lines of text.
  3. Long-press the empty input and choose Paste.
  4. Record the screen and step through the frames: the first frame after the paste shows the lines packed tighter than 32 px, the next frame shows them on the 32 px rules.

React Native Version

0.81.5

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info

React Native 0.81.5, React 19.1.0, Expo SDK 54, New Architecture enabled, Hermes.
Seen on an Android 15 emulator (x86_64) and an Android 17 Pixel 7.

Stacktrace or Logs

No crash or log output; visual issue only.

MANDATORY Reproducer

https://snack.expo.dev/zPf9gw4MWrM457bRuFSay

Screenshots and Videos

From a screen recording of the paste: in the frame right after the paste the line pitch is about 60 px at device scale; in the next frame it is 84 px (32 dp), so the last line moves down by about 128 px.

Activity

  1. react-native-bot commented on Nov 21, 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.

  2. karroge10 commented on Nov 21, 2026

    @karroge10
    Author

    Added a Snack reproducer: https://snack.expo.dev/zPf9gw4MWrM457bRuFSay (run on Android, paste three or four lines into the empty input and step through a screen recording).

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: AttentionIssues where the author has responded to feedback.Needs: 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