[Android] Content jump in multiline TextInput
when adding/removing line of text due to delayed layout update happening after content update
#46813
Labels
Component: TextInput
Related to the TextInput component.
Needs: Triage 🔍
p: Software Mansion
Partner: Software Mansion
Partner
Platform: Android
Android applications.
Type: New Architecture
Issues and PRs related to new architecture (Fabric/Turbo Modules)
Description
When adding a new line of text in multiline
TextInput
component (e.g. after pressing Enter), there's a slight delay between updating the content of the text and updating the height of the component (i.e. layout) on Android with New Architecture enabled.This causes a content jump (to the top and back to the bottom) visible for one or more frames.
Before adding newline (correct):
After pressing "Enter" (incorrect frame):
After one or more frames (correct):
Video recording:
Screen.Recording.2024-10-03.at.16.39.54.mov
Note that there's also an issue with measuring the height of the last line of the text if it's empty but it's already fixed by @j-piasecki in #42331 as well as by @NickGerleman in #46613 but the issue with content jump still persists.
Steps to reproduce
React Native Version
0.76.0-rc.3
Affected Platforms
Runtime - Android
Areas
Fabric - The New Renderer
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/tomekzaw/repro-new-arch-android-textinput
Screenshots and Videos
Screen.Recording.2024-10-03.at.16.39.54.mov
The text was updated successfully, but these errors were encountered: