From cb3efade939d92cddb557c4da93a41fa67da34e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Thu, 14 Nov 2024 03:37:58 -0800 Subject: [PATCH] Fix bug in ReadOnlyNode.compareDocumentPosition (#47557) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47557 Changelog: [internal] Not published as a bugfix because this API isn't enabled in OSS yet. Reviewed By: sammy-SC Differential Revision: D65769326 --- packages/react-native/ReactCommon/react/renderer/dom/DOM.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/ReactCommon/react/renderer/dom/DOM.cpp b/packages/react-native/ReactCommon/react/renderer/dom/DOM.cpp index 6748efa540d949..a9b6645d541aae 100644 --- a/packages/react-native/ReactCommon/react/renderer/dom/DOM.cpp +++ b/packages/react-native/ReactCommon/react/renderer/dom/DOM.cpp @@ -211,7 +211,7 @@ uint_fast16_t compareDocumentPosition( auto otherAncestors = otherShadowNode.getFamily().getAncestors(*currentRevision); - if (ancestors.empty()) { + if (otherAncestors.empty()) { return DOCUMENT_POSITION_DISCONNECTED; }