TextInput renders text outside of text field for certain scales
Problem Description
At certain display scales (reproducible at 100%), the <TextInput/> component renders text outside the boundaries of the text field. When typing into the TextInput, the entered text overflows and appears outside the input container rather than being properly contained within it.
Steps To Reproduce
This issue is reproducible consistently at the affected display scale (in my testing at 100% scale). Simply rendering a multiline TextInput and typing any text will cause the text to appear outside the field boundaries.
import { View, StyleSheet } from 'react-native';
import { TextInput } from 'react-native-windows';
export const ReproExample = () => {
return (
<View style={styles.container}>
<TextInput
style={styles.textInput}
placeholder="Type here..."
In the following <TextInput/> I just wrote "This is a test" and the text was renderer outside of the text field.
Expected Results
No response
CLI version
20.0.0
Environment
info Fetching system and libraries information...
System:
OS: Windows 11 10.0.26100
CPU: (12) x64 13th Gen Intel(R) Core(TM) i7-1365U
Memory: 5.44 GB / 31.64 GB
Binaries:
Node:
version: 22.13.0
path: C:\nvm4w\nodejs\node.exe
Yarn:
version: 1.22.22
path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm:
version: 10.9.2
path: C:\nvm4w\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
AllowAllTrustedApps: Enabled
Versions:
- 10.0.19041.0
- 10.0.22621.0
- 10.0.26100.0
IDEs:
Android Studio: Not Found
Visual Studio:
- 16.11.37206.5 (Visual Studio Professional 2019)
- 17.14.37216.2 (Visual Studio Community 2022)
Languages:
Java:
version: 2.formatMsgNoLookups
path: ******
Ruby:
version: 3.0.2
path: C:\tools\ruby30\bin\ruby.exe
npmPackages:
"@react-native-community/cli":
installed: 20.0.0
wanted: 20.0.0
react:
installed: 19.1.4
wanted: 19.1.4
react-native:
installed: 0.81.6
wanted: 0.81.6
react-native-windows:
installed: 0.81.15
wanted: 0.81.15
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
Community Modules
No response
Target React Native Architecture
None
Target Platform Version
None
Visual Studio Version
None
Build Configuration
None
Snack, code example, screenshot, or link to a repository
No response
I have seen this intermittently when switching monitors. It seems to happen when building the app on a display with 150% scale then moving the app to a display with 100% scale. Sometimes the text will be completely invisible, although the text cursor is still visible.
OS: windows 11 24H2 26100.8246 react: 19.2.5 react-native: 0.81.6 react-native-windows: 0.81.15
Confirmed this exists in 0.81.28 also. Seems to be reproducible with laptop monitor at 175% and second monitor at 100% scaling.
- Launch app on main screen scaled at 175% with TextInput hidden with a button
- Drag app to second monitor at 100% scaling
- Make TextInput visible, text in box is not visible.
@acoates-ms Also exists in 0.83, reproduced in a clean minimal project.
Added some PRs to fix this and backport it to previous versions. I found that it can be reproduced in the simplest case via the following steps:
- Using 2+ monitors, set main monitor to >100% screen scaling, and secondary monitor to 100% screen scaling
- Launch any RNW app on the main monitor (e.g. the E2E-testing app)
- Drag the app window to the secondary monitor
- Render some new text inputs in the app(this can be done easily in the E2E-testing app by opening the Text Input section)
- See the issue above