Skip to content

Commit

Permalink
Support WinAppSDK + cppwinrt 2.240111.5
Browse files Browse the repository at this point in the history
See microsoft/cppwinrt#1393

We need to first convert the WinUI 3 control to IControlProtected to
access GetTemplateChild.
  • Loading branch information
rozele committed Mar 20, 2024
1 parent 86bf444 commit 5f392af
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vnext/Microsoft.ReactNative/Views/TextInputViewManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,11 @@ void TextInputShadowNode::registerEvents() {
}
}

#ifdef USE_WINUI3
auto contentElement = control.as<xaml::Controls::IControlProtected>().GetTemplateChild(L"ContentElement");
#else
auto contentElement = control.GetTemplateChild(L"ContentElement");
#endif
auto textBoxView = contentElement.as<xaml::Controls::ScrollViewer>();
if (textBoxView) {
m_scrollViewerViewChangingRevoker = textBoxView.ViewChanging(
Expand Down

0 comments on commit 5f392af

Please sign in to comment.