From 778a82d434d097117ca3e3e6f77c47ece95f132f Mon Sep 17 00:00:00 2001 From: Abhijeet Jha <74712637+iamAbhi-916@users.noreply.github.com> Date: Wed, 15 Apr 2026 10:45:04 +0530 Subject: [PATCH] [0.84] Fix multiline TextInput crash from TxDrawD2D reentrancy (#15990) * Fix multiline TextInput crash from TxDrawD2D reentrancy * Change files --- ...ative-windows-fd21e9f2-3f90-4b4a-94f5-fbf8802080dc.json | 7 +++++++ .../TextInput/WindowsTextInputComponentView.cpp | 3 +++ 2 files changed, 10 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" +} 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