@buoy-gg/highlight-updates 4.0.1 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1038,9 +1038,17 @@ function findScrollAncestor(stateNode) {
1038
1038
  while (fiber && guard++ < 200) {
1039
1039
  const inst = fiber.stateNode;
1040
1040
  if (inst && typeof inst.scrollTo === "function") {
1041
+ // getInnerViewNode()/getScrollableNode() return a numeric node handle —
1042
+ // only valid for the legacy UIManager.measureLayout fallback below.
1043
+ // Fabric's ref.measureLayout requires an actual host-component ref
1044
+ // (getNativeScrollRef()); passing it a number trips a dev warning
1045
+ // ("ref.measureLayout must be called with a ref to a native component")
1046
+ // and silently resolves neither callback.
1047
+ const nativeRef = typeof inst.getNativeScrollRef === "function" && inst.getNativeScrollRef() || null;
1041
1048
  const innerNode = typeof inst.getInnerViewNode === "function" && inst.getInnerViewNode() || typeof inst.getScrollableNode === "function" && inst.getScrollableNode() || inst;
1042
1049
  return {
1043
1050
  instance: inst,
1051
+ nativeRef,
1044
1052
  innerNode
1045
1053
  };
1046
1054
  }
@@ -1087,8 +1095,8 @@ async function scrollDescendantIntoView(stateNode, publicInstance, margin) {
1087
1095
  settle(null);
1088
1096
  }
1089
1097
  });
1090
- if (typeof inst.measureLayout === "function") {
1091
- top = await withTimeout(resolve => inst.measureLayout(ancestor.innerNode, (_left, t) => resolve(t), () => resolve(null)));
1098
+ if (ancestor.nativeRef && typeof inst.measureLayout === "function") {
1099
+ top = await withTimeout(resolve => inst.measureLayout(ancestor.nativeRef, (_left, t) => resolve(t), () => resolve(null)));
1092
1100
  }
1093
1101
  if (top == null) {
1094
1102
  const targetHandle = (0, _reactNative.findNodeHandle)(publicInstance);