Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
Component: TextInputRelated to the TextInput component.Related to the TextInput component.Needs: AttentionIssues where the author has responded to feedback.Issues where the author has responded to feedback.Needs: ReproThis issue could be improved with a clear list of steps to reproduce the issue.This issue could be improved with a clear list of steps to reproduce the issue.Platform: AndroidAndroid applications.Android applications.StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.
Description
Description
I upgraded React Native from version 0.73.2 to 0.80.1 and also updated the targetSdkVersion to 35. After the upgrade, I noticed that when entering text in the TextInput component, the text is vertically shifted upwards, while the cursor remains vertically centered.
Here’s the style I was using:
style={{
backgroundColor: '#eee',
height: 40,
paddingTop: 10,
paddingBottom: 10,
lineHeight: 20,
fontSize: 16,
includeFontPadding: true,
textAlignVertical: 'center',
}}However, if I change the style to:
style={{
backgroundColor: '#eee',
height: 40,
lineHeight: 40,
fontSize: 16,
}}And if I remove the height:
style={{
backgroundColor: '#eee',
lineHeight: 40,
fontSize: 16,
}}The result looks like this:
Steps to reproduce
1、Updated the targetSdkVersion to 35
2、Write the following components
<TextInput
keyboardType="numeric"
placeholderTextColor="#999"
style={{
backgroundColor: '#eee',
height: 40,
paddingTop: 10,
paddingBottom: 10,
lineHeight: 20,
fontSize: 16,
includeFontPadding: true,
textAlignVertical: 'center',
}}
/>3、Running on Android 15(My phone is Xiaomi 15)
React Native Version
0.80.1
Affected Platforms
Runtime - Android
Output of npx @react-native-community/cli info
System:
OS: macOS 15.4.1
CPU: (8) arm64 Apple M1 Pro
Memory: 135.30 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 18.18.0
path: ~/.nvm/versions/node/v18.18.0/bin/node
Yarn:
version: 4.9.2
path: ~/.nvm/versions/node/v18.18.0/bin/yarn
npm:
version: 9.8.1
path: ~/.nvm/versions/node/v18.18.0/bin/npm
Watchman:
version: 2024.08.12.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.15.2
path: /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 24.2
- iOS 18.2
- macOS 15.2
- tvOS 18.2
- visionOS 2.2
- watchOS 11.2
Android SDK: Not Found
IDEs:
Android Studio: 2022.3 AI-223.8836.35.2231.10671973
Xcode:
version: 16.2/16C5032a
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.9
path: /usr/bin/javac
Ruby:
version: 2.6.10
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli":
installed: 19.0.0
wanted: 19.0.0
react:
installed: 19.1.0
wanted: 19.1.0
react-native:
installed: 0.80.1
wanted: 0.80.1
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: true
newArchEnabled: true
Stacktrace or Logs
none
MANDATORY Reproducer
https://snack.expo.dev/@bs3385/textinput
Screenshots and Videos
No response
Reacted by NorLz
Reacted by Alvin Huang and chengjieLee
Metadata
Metadata
Assignees
Labels
Component: TextInputRelated to the TextInput component.Related to the TextInput component.Needs: AttentionIssues where the author has responded to feedback.Issues where the author has responded to feedback.Needs: ReproThis issue could be improved with a clear list of steps to reproduce the issue.This issue could be improved with a clear list of steps to reproduce the issue.Platform: AndroidAndroid applications.Android applications.StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.


Activity
react-native-bot commentedon Jul 23, 2025
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.
BS3385 commentedon Jul 23, 2025
https://snack.expo.dev/@bs3385/textinput
cipolleschi commentedon Jul 23, 2025
Hi @BS3385 thanks for the issue.
Have you tried disabling the new architecture in your
app/build.gradlefile? Just to understand if this is a New Arch specific issue or if it was like that in the Legacy architecture as well.Jumping from 0.73 to 0.80 is a big jump, so I'd also suggest you to go through the blogpost we published in https://reactnative.dev/blog to look for possible braking changes we announced there.
cc. @cortinico
cipolleschi commentedon Jul 23, 2025
Also, the snack doesn't show the bug:
cortinico commentedon Jul 23, 2025
@BS3385 In order to triage this further we would need to isolate when is this happening.
Specifically, in a sample project on 0.80 please try and verify if:
a. It happens on old/new arch?
b. It happens on target SDK 34/35/36?
And please report back.
NickGerleman commentedon Jul 24, 2025
Depending on locale, https://developer.android.com/about/versions/15/behavior-changes-15#elegant-text-height is an "interesting" change that I have no idea if we are supporting correctly (I would hazard a guess that we may not, until maybe some very recent changes).
@BS3385 what locale is your phone?
BS3385 commentedon Jul 24, 2025
I’m using the new architecture.
Are you testing with the Android 15 preview demo? I’ve noticed issues when previewing with that demo.
Also, based on my debugging, the problem seems to be related to upgrading the targetSdkVersion to 35. I tested this with React Native 0.73.2 as well, and once targetSdkVersion was set to 35, the issue appeared on Android 15 too. However, it displays correctly on versions prior to Android 15. @cortinico @cipolleschi
14 remaining items
milandexiaozhen commentedon Jul 25, 2025
Solution:
1. Download the Roboto font folder from the official Google Fonts website.
In the static directory, choose Roboto-Regular.ttf and Roboto-Bold.ttf, then copy them to:
android/app/src/main/assets/fonts
https://fonts.google.com/specimen/Roboto?utm_source=chatgpt.com
2. Run the following command:npx react-native-asset
3. cd android && ./gradlew clean
4. In your index.ts file, add the following code:
if (Platform.OS === 'android') {
const defaultInputStyle = TextInput.defaultProps.style || {};
TextInput.defaultProps.style = [defaultInputStyle, { fontFamily: 'Roboto-Regular' }];
}
5.For any TextInput that uses fontWeight: 'bold',
remove that line and replace it with:fontFamily: 'Roboto-Bold'
This will solve the issue.
xulePlus commentedon Jul 25, 2025
Recommended open source font library download address
https://fonts.google.com/specimen/Roboto?utm_source=chatgpt.com
BS3385 commentedon Jul 31, 2025
Xiaomi replied that it will optimize the display issue of "MiSans" in subsequent versions
alanleedev commentedon Aug 1, 2025
@BS3385 Thanks for the update
MarchewkaMatthew commentedon Aug 22, 2025
It seems that having Persian set as a phone language (and probably other languages mentioned here: https://developer.android.com/about/versions/15/behavior-changes-15#elegant-text-height ) may cause unexpected font issues. Surprisingly, even if these languages are set as a secondary language, they might still break something.
In my case, on a Samsung S22 (Android 15) with German set as the primary language and Persian as the secondary, some texts in the app were cut off at the top (see attached screenshot).
Issue started to appear when we changed the targetSdkVersion to 35 (we are on 0.76.9 version of react-native).
Do you know what might be causing this, and how we can fix it?
klxiaoniu commentedon Aug 22, 2025
For Xiaomi device running HyperOS2 Android 15, font set to MiSans, language Chinese, add these to
android/app/src/main/res/values/styles.xmlinside<resources> </resources>tag: (Choose parent style according to your app)And then edit your Base application theme to add these inside
<style> </style>tag:Then recompile your app, the issue should be gone.
If you are using expo, you can use this plugin.
This is related to Changes introduced in Android 15, apps targeting Android 15 will apply these by default, while Xiaomi system and font developers made these features broken.😡 So we have to disable them manually.
Ps: It's said that the bug is fixed in Xiaomi Android 16 system, but I don't have any device to test that.
alanleedev commentedon Sep 4, 2025
@MarchewkaMatthew You should file a new issue with code to reproduce the problem.
pierroo commentedon Sep 29, 2025
This may also be linked to the issue of Texts being cut randomly since 0.80+, I had created an issue as well about it:
#53666
ysng007 commentedon Oct 16, 2025
I tested it with Xiaomi Android 16 and there is no problem
Super-Crab commentedon Dec 5, 2025
@BS3385 you can try to fixed the method of "updateTextPaint" in TextLayoutManager.TextPaint use reset API,but reset has bug in HyperOS2
fix: android text input clipping on SDK 35
react-native-bot commentedon Jun 4, 2026
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
react-native-bot commentedon Jun 13, 2026
This issue was closed because it has been stalled for 7 days with no activity.