File tree Expand file tree Collapse file tree 3 files changed +24
-16
lines changed
vnext/Microsoft.ReactNative/Fabric/Composition Expand file tree Collapse file tree 3 files changed +24
-16
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "type" : " patch" ,
3+ "comment" : " Assert on text input focus when no UIA tool running" ,
4+ "packageName" : " react-native-windows" ,
5+ 6+ "dependentChangeType" : " patch"
7+ }
Original file line number Diff line number Diff line change @@ -966,12 +966,17 @@ void CompositionEventHandler::getTargetPointerArgs(
966966 assert (m_pointerCapturingComponentTag != -1 );
967967 tag = m_pointerCapturingComponentTag;
968968
969- auto targetComponentView = fabricuiManager->GetViewRegistry ().componentViewDescriptorWithTag (tag).view ;
970- auto clientRect = winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(targetComponentView)
971- ->getClientRect ();
972- if (auto strongRootView = m_wkRootView.get ()) {
973- ptLocal.x = ptScaled.x - (clientRect.left / strongRootView.ScaleFactor ());
974- ptLocal.y = ptScaled.y - (clientRect.top / strongRootView.ScaleFactor ());
969+ auto targetComponentView = fabricuiManager->GetViewRegistry ().findComponentViewWithTag (tag);
970+ if (targetComponentView) {
971+ auto clientRect =
972+ winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(targetComponentView)
973+ ->getClientRect ();
974+ if (auto strongRootView = m_wkRootView.get ()) {
975+ ptLocal.x = ptScaled.x - (clientRect.left / strongRootView.ScaleFactor ());
976+ ptLocal.y = ptScaled.y - (clientRect.top / strongRootView.ScaleFactor ());
977+ }
978+ } else {
979+ tag = -1 ;
975980 }
976981 } else {
977982 tag = RootComponentView ().hitTest (ptScaled, ptLocal);
Original file line number Diff line number Diff line change @@ -374,13 +374,12 @@ winrt::IInspectable ReactNativeIsland::GetUiaProvider() noexcept {
374374 if (m_uiaProvider == nullptr ) {
375375 m_uiaProvider =
376376 winrt::make<winrt::Microsoft::ReactNative::implementation::CompositionRootAutomationProvider>(*this );
377- if (m_hwnd && !m_island) {
378- auto pRootProvider =
379- static_cast <winrt::Microsoft::ReactNative::implementation::CompositionRootAutomationProvider *>(
380- m_uiaProvider.as <IRawElementProviderSimple>().get ());
381- if (pRootProvider != nullptr ) {
382- pRootProvider->SetHwnd (m_hwnd);
383- }
377+ auto pRootProvider =
378+ static_cast <winrt::Microsoft::ReactNative::implementation::CompositionRootAutomationProvider *>(
379+ m_uiaProvider.as <IRawElementProviderSimple>().get ());
380+ if (pRootProvider != nullptr ) {
381+ pRootProvider->SetIsland (m_island);
382+ pRootProvider->SetHwnd (m_hwnd);
384383 }
385384 }
386385 return m_uiaProvider;
@@ -868,9 +867,6 @@ winrt::Microsoft::UI::Content::ContentIsland ReactNativeIsland::Island() {
868867 auto pRootProvider =
869868 static_cast <winrt::Microsoft::ReactNative::implementation::CompositionRootAutomationProvider *>(
870869 provider.as <IRawElementProviderSimple>().get ());
871- if (pRootProvider != nullptr ) {
872- pRootProvider->SetIsland (pThis->m_island );
873- }
874870 args.AutomationProvider (std::move (provider));
875871 args.Handled (true );
876872 }
You can’t perform that action at this time.
0 commit comments