diff --git a/change/react-native-windows-77fda7b1-66d2-49d3-998b-cbe38717cf0e.json b/change/react-native-windows-77fda7b1-66d2-49d3-998b-cbe38717cf0e.json new file mode 100644 index 00000000000..d6062d163d3 --- /dev/null +++ b/change/react-native-windows-77fda7b1-66d2-49d3-998b-cbe38717cf0e.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Fix single-line TextInput text drawn below center by measuring content with an unconstrained height", + "packageName": "react-native-windows", + "email": "ryan.fowler@singlewire.com", + "dependentChangeType": "patch" +} diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp index 91ae1551daf..4fa90e37194 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp @@ -1373,7 +1373,10 @@ std::pair WindowsTextInputComponentView::GetContentSize() const no SIZE extentHimetric = { static_cast(availableWidth * scale * HIMETRIC_PER_INCH / dpi), - static_cast(std::numeric_limits::max() * HIMETRIC_PER_INCH / dpi)}; + // -1 measures without zoom, matching how this host draws (TxGetExtent returns E_NOTIMPL). + // A positive extent is taken as a zoom reference; LONG_MAX scaled to HIMETRIC saturated to a + // huge positive value on ARM64 and shrank the natural height to about 0. + -1}; SIZE naturalSize = {0, 0};