Skip to content

Commit

Permalink
[Fabric] Fix crash when running inspect (#13592)
Browse files Browse the repository at this point in the history
* [Fabric] Fix crash when running inspect

* Change files

* fix
  • Loading branch information
acoates-ms authored Aug 20, 2024
1 parent 6661e35 commit a9e5ef1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "[Fabric] Fix crash when running inspect",
"packageName": "react-native-windows",
"email": "30809111+acoates-ms@users.noreply.github.com",
"dependentChangeType": "patch"
}
7 changes: 4 additions & 3 deletions vnext/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ HRESULT UiaNavigateHelper(
auto parentCV = view.Parent().as<winrt::Microsoft::ReactNative::Composition::implementation::ComponentView>();
if (parentCV != nullptr) {
auto children = parentCV->Children();
for (auto it = children.end(); it != children.begin(); --it) {
if (*it == view) {
uiaProvider = (*it)
for (auto i = children.Size() - 1; i > 0; i--) {
auto child = children.GetAt(i);
if (child == view) {
uiaProvider = children.GetAt(i - 1)
.as<winrt::Microsoft::ReactNative::Composition::implementation::ComponentView>()
->EnsureUiaProvider();
break;
Expand Down

0 comments on commit a9e5ef1

Please sign in to comment.