Skip to content

Commit a6e0049

Browse files
fix(mobile): keep scroll bounds current after animations
1 parent d7d2962 commit a6e0049

2 files changed

Lines changed: 23 additions & 13 deletions

File tree

‎patches/@[email protected]‎

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,7 +1404,7 @@ index f1265fad74189591b5aae86cf2e3a31f9c0fdb02..59e218cb79f56c34995fb86c5de5a71f
14041404
ref: refView,
14051405
style: viewStyle,
14061406
...rest
1407-
@@ -141,6 +162,96 @@ var ReanimatedPositionView = typedMemo(function ReanimatedPositionViewComponent(
1407+
@@ -141,6 +162,101 @@ var ReanimatedPositionView = typedMemo(function ReanimatedPositionViewComponent(
14081408
children
14091409
);
14101410
});
@@ -1495,13 +1495,18 @@ index f1265fad74189591b5aae86cf2e3a31f9c0fdb02..59e218cb79f56c34995fb86c5de5a71f
14951495
+ }));
14961496
+ })(logicalSize, previousLogicalSize, wasAnimating, run, epoch);
14971497
+ }, [baseSize, animatedDelta, canAnimate, completeAnimation, ctx.state, logicalSize, renderEpoch, signalName, transition]);
1498-
+ const sizeStyle = useAnimatedAxis ? animatedStyle : horizontal ? { width: logicalSize } : { height: logicalSize };
1499-
+ return /* @__PURE__ */ React__namespace.createElement(Reanimated__default.default.View, { ...rest, style: [style, sizeStyle] }, children);
1498+
+ // Keep the content container under one animated size owner because detaching an
1499+
+ // animated dimension can leave its native override behind. The alignment spacer
1500+
+ // is empty, so it can safely remount as a numeric View for keyboard geometry.
1501+
+ const isContentContainer = signalName === "totalSize";
1502+
+ const sizeStyle = isContentContainer || useAnimatedAxis ? animatedStyle : horizontal ? { width: logicalSize } : { height: logicalSize };
1503+
+ const SizeView = isContentContainer || useAnimatedAxis ? Reanimated__default.default.View : ReactNative.View;
1504+
+ return /* @__PURE__ */ React__namespace.createElement(SizeView, { ...rest, style: [style, sizeStyle] }, children);
15001505
+});
15011506
function setSharedValueValue(sharedValue, value) {
15021507
if (!sharedValue) {
15031508
return;
1504-
@@ -245,10 +356,19 @@ var LegendListForwardedRef = typedMemo(
1509+
@@ -245,10 +361,19 @@ var LegendListForwardedRef = typedMemo(
15051510
);
15061511
};
15071512
}, [hasItemLayoutAnimation, recycleItems]);
@@ -1577,7 +1582,7 @@ index 29a00d5dc084fd408a0e0a0a4d64e856d0ed1525..bd3c680eb4abeca786d538ebf7b23a57
15771582
ref: refView,
15781583
style: viewStyle,
15791584
...rest
1580-
@@ -117,6 +138,96 @@ var ReanimatedPositionView = typedMemo(function ReanimatedPositionViewComponent(
1585+
@@ -117,6 +138,101 @@ var ReanimatedPositionView = typedMemo(function ReanimatedPositionViewComponent(
15811586
children
15821587
);
15831588
});
@@ -1668,13 +1673,18 @@ index 29a00d5dc084fd408a0e0a0a4d64e856d0ed1525..bd3c680eb4abeca786d538ebf7b23a57
16681673
+ }));
16691674
+ })(logicalSize, previousLogicalSize, wasAnimating, run, epoch);
16701675
+ }, [baseSize, animatedDelta, canAnimate, completeAnimation, ctx.state, logicalSize, renderEpoch, signalName, transition]);
1671-
+ const sizeStyle = useAnimatedAxis ? animatedStyle : horizontal ? { width: logicalSize } : { height: logicalSize };
1672-
+ return /* @__PURE__ */ React.createElement(Reanimated.View, { ...rest, style: [style, sizeStyle] }, children);
1676+
+ // Keep the content container under one animated size owner because detaching an
1677+
+ // animated dimension can leave its native override behind. The alignment spacer
1678+
+ // is empty, so it can safely remount as a numeric View for keyboard geometry.
1679+
+ const isContentContainer = signalName === "totalSize";
1680+
+ const sizeStyle = isContentContainer || useAnimatedAxis ? animatedStyle : horizontal ? { width: logicalSize } : { height: logicalSize };
1681+
+ const SizeView = isContentContainer || useAnimatedAxis ? Reanimated.View : View;
1682+
+ return /* @__PURE__ */ React.createElement(SizeView, { ...rest, style: [style, sizeStyle] }, children);
16731683
+});
16741684
function setSharedValueValue(sharedValue, value) {
16751685
if (!sharedValue) {
16761686
return;
1677-
@@ -221,10 +332,19 @@ var LegendListForwardedRef = typedMemo(
1687+
@@ -221,10 +337,19 @@ var LegendListForwardedRef = typedMemo(
16781688
);
16791689
};
16801690
}, [hasItemLayoutAnimation, recycleItems]);

‎pnpm-lock.yaml‎

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)