From 88f1cf554eeeabf1ce02b06536eaf489174fc45b Mon Sep 17 00:00:00 2001 From: Abhijeet Jha <74712637+iamAbhi-916@users.noreply.github.com> Date: Tue, 14 Apr 2026 22:04:26 +0530 Subject: [PATCH 1/2] Fix multiline TextInput crash from TxDrawD2D reentrancy --- .../Composition/TextInput/WindowsTextInputComponentView.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp index 59cbe03aa61..7a5f30d8a66 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp @@ -1780,7 +1780,10 @@ void WindowsTextInputComponentView::DrawText() noexcept { } // TODO keep track of proper invalid rect + // Prevent reentrancy: TxDrawD2D may call TxViewChange -> DrawText + m_cDrawBlock++; auto hrDraw = m_textServices->TxDrawD2D(d2dDeviceContext, &rc, nullptr, TXTVIEW_ACTIVE); + m_cDrawBlock--; winrt::check_hresult(hrDraw); // draw placeholder text if needed From 54531ff58aa46da9dc16bedd1725d4a7dee9219e Mon Sep 17 00:00:00 2001 From: Abhijeet Jha <74712637+iamAbhi-916@users.noreply.github.com> Date: Tue, 14 Apr 2026 22:05:15 +0530 Subject: [PATCH 2/2] Change files --- ...ative-windows-fd21e9f2-3f90-4b4a-94f5-fbf8802080dc.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/react-native-windows-fd21e9f2-3f90-4b4a-94f5-fbf8802080dc.json diff --git a/change/react-native-windows-fd21e9f2-3f90-4b4a-94f5-fbf8802080dc.json b/change/react-native-windows-fd21e9f2-3f90-4b4a-94f5-fbf8802080dc.json new file mode 100644 index 00000000000..82689dec243 --- /dev/null +++ b/change/react-native-windows-fd21e9f2-3f90-4b4a-94f5-fbf8802080dc.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Fix multiline TextInput crash from TxDrawD2D reentrancy", + "packageName": "react-native-windows", + "email": "74712637+iamAbhi-916@users.noreply.github.com", + "dependentChangeType": "patch" +}