From 467a8d50aa3c919640ae24256d49b1e2778ea8eb Mon Sep 17 00:00:00 2001 From: Eric Rozell Date: Thu, 28 Mar 2024 18:02:20 -0400 Subject: [PATCH] Support WinAppSDK + cppwinrt 2.240111.5 (#12862) * Support WinAppSDK + cppwinrt 2.240111.5 See https://github.com/microsoft/cppwinrt/issues/1393 We need to first convert the WinUI 3 control to IControlProtected to access GetTemplateChild. * Change files * Apply C++/WinRT fix to both UWP and WinAppSDK --- ...ative-windows-cf526fee-a8ea-4093-a2b9-326406f5c5ac.json | 7 +++++++ vnext/Microsoft.ReactNative/Views/TextInputViewManager.cpp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 change/react-native-windows-cf526fee-a8ea-4093-a2b9-326406f5c5ac.json diff --git a/change/react-native-windows-cf526fee-a8ea-4093-a2b9-326406f5c5ac.json b/change/react-native-windows-cf526fee-a8ea-4093-a2b9-326406f5c5ac.json new file mode 100644 index 00000000000..a00fb7b2e17 --- /dev/null +++ b/change/react-native-windows-cf526fee-a8ea-4093-a2b9-326406f5c5ac.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Support WinAppSDK + cppwinrt 2.240111.5", + "packageName": "react-native-windows", + "email": "erozell@outlook.com", + "dependentChangeType": "patch" +} diff --git a/vnext/Microsoft.ReactNative/Views/TextInputViewManager.cpp b/vnext/Microsoft.ReactNative/Views/TextInputViewManager.cpp index ab96cefff02..feed6c1e0c3 100644 --- a/vnext/Microsoft.ReactNative/Views/TextInputViewManager.cpp +++ b/vnext/Microsoft.ReactNative/Views/TextInputViewManager.cpp @@ -319,7 +319,7 @@ void TextInputShadowNode::registerEvents() { } } - auto contentElement = control.GetTemplateChild(L"ContentElement"); + auto contentElement = control.as().GetTemplateChild(L"ContentElement"); auto textBoxView = contentElement.as(); if (textBoxView) { m_scrollViewerViewChangingRevoker = textBoxView.ViewChanging(