@buoy-gg/highlight-updates 4.0.1 → 4.0.2
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.
- package/lib/commonjs/highlight-updates/utils/HighlightUpdatesController.js +10 -2
- package/lib/commonjs/highlight-updates/utils/screenElements.js +721 -0
- package/lib/commonjs/sync/highlightUpdatesSyncAdapter.js +10 -1
- package/lib/module/highlight-updates/utils/HighlightUpdatesController.js +10 -2
- package/lib/module/highlight-updates/utils/screenElements.js +717 -0
- package/lib/module/sync/highlightUpdatesSyncAdapter.js +10 -1
- package/lib/typescript/highlight-updates/utils/HighlightUpdatesController.d.ts.map +1 -1
- package/lib/typescript/highlight-updates/utils/screenElements.d.ts +96 -0
- package/lib/typescript/highlight-updates/utils/screenElements.d.ts.map +1 -0
- package/lib/typescript/sync/highlightUpdatesSyncAdapter.d.ts +2 -0
- package/lib/typescript/sync/highlightUpdatesSyncAdapter.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -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.
|
|
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);
|