Skip to content
TypeScript

fix(web): model picker no longer jumps at the end of its open animation (#19506)

Claudesaul6dc14625b550
diff --git a/patches/@[email protected] b/patches/@[email protected]
index 88b739824b0..e79a4a7ff16 100644
--- a/patches/@[email protected]
+++ b/patches/@[email protected]
@@ -1447,7 +1447,7 @@ index 95465f2..d7cbe1c 100644
}
}
diff --git a/react.js b/react.js
-index 914d2da..0c2917d 100644
+index 914d2da..86dbd9a 100644
--- a/react.js
+++ b/react.js
@@ -4702,7 +4702,8 @@ function maybeUpdateAnchoredEndSpace(ctx) {
@@ -1473,7 +1473,17 @@ index 914d2da..0c2917d 100644
}
return nextSize;
}
-@@ -5651,6 +5658,18 @@ var ContainerSlot = typedMemo(function ContainerSlot2(props) {
+@@ -4956,7 +4963,8 @@ function measureContainersInLayoutEffect(ctx, targetContainerIds = null) {
+ const itemKey = peek$(ctx, `containerItemKey${containerId}`);
+ const element = viewRef == null ? void 0 : viewRef.current;
+ if (itemKey !== void 0 && element) {
+- const rect = element.getBoundingClientRect();
++ // Unlike getBoundingClientRect, offset sizes ignore ancestor transforms (e.g. a popup's zoom-in), like ResizeObserver.
++ const rect = { height: element.offsetHeight, width: element.offsetWidth };
+ setContainerLayoutBaseline(element, rect);
+ measurements.push({
+ containerId,
+@@ -5651,6 +5659,18 @@ var ContainerSlot = typedMemo(function ContainerSlot2(props) {
});
// src/utils/reordering.ts
@@ -1492,7 +1502,7 @@ index 914d2da..0c2917d 100644
function sortDOMElements(container, indexByElement) {
const elements = Array.from(container.children);
if (elements.length <= 1) return elements;
-@@ -5690,9 +5709,9 @@ function sortDOMElements(container, indexByElement) {
+@@ -5690,9 +5710,9 @@ function sortDOMElements(container, indexByElement) {
}
}
if (nextStableElement) {
@@ -1504,7 +1514,7 @@ index 914d2da..0c2917d 100644
}
}
}
-@@ -6446,8 +6465,8 @@ function ScrollAdjust() {
+@@ -6446,8 +6466,8 @@ function ScrollAdjust() {
window.getComputedStyle(contentNode)[axis.paddingEndProp]
);
const temporaryPaddingEnd = `${(currentPaddingEnd || 0) + pad}px`;
@@ -1515,7 +1525,7 @@ index 914d2da..0c2917d 100644
scrollBy();
if (resetPaddingRafRef.current !== void 0) {
diff --git a/react.mjs b/react.mjs
-index 95465f2..b73bfdf 100644
+index 95465f2..cff49dc 100644
--- a/react.mjs
+++ b/react.mjs
@@ -4681,7 +4681,8 @@ function maybeUpdateAnchoredEndSpace(ctx) {
@@ -1541,7 +1551,17 @@ index 95465f2..b73bfdf 100644
}
return nextSize;
}
-@@ -5630,6 +5637,18 @@ var ContainerSlot = typedMemo(function ContainerSlot2(props) {
+@@ -4935,7 +4942,8 @@ function measureContainersInLayoutEffect(ctx, targetContainerIds = null) {
+ const itemKey = peek$(ctx, `containerItemKey${containerId}`);
+ const element = viewRef == null ? void 0 : viewRef.current;
+ if (itemKey !== void 0 && element) {
+- const rect = element.getBoundingClientRect();
++ // Unlike getBoundingClientRect, offset sizes ignore ancestor transforms (e.g. a popup's zoom-in), like ResizeObserver.
++ const rect = { height: element.offsetHeight, width: element.offsetWidth };
+ setContainerLayoutBaseline(element, rect);
+ measurements.push({
+ containerId,
+@@ -5630,6 +5638,18 @@ var ContainerSlot = typedMemo(function ContainerSlot2(props) {
});
// src/utils/reordering.ts
@@ -1560,7 +1580,7 @@ index 95465f2..b73bfdf 100644
function sortDOMElements(container, indexByElement) {
const elements = Array.from(container.children);
if (elements.length <= 1) return elements;
-@@ -5669,9 +5688,9 @@ function sortDOMElements(container, indexByElement) {
+@@ -5669,9 +5689,9 @@ function sortDOMElements(container, indexByElement) {
}
}
if (nextStableElement) {
@@ -1572,7 +1592,7 @@ index 95465f2..b73bfdf 100644
}
}
}
-@@ -6425,8 +6444,8 @@ function ScrollAdjust() {
+@@ -6425,8 +6445,8 @@ function ScrollAdjust() {
window.getComputedStyle(contentNode)[axis.paddingEndProp]
);
const temporaryPaddingEnd = `${(currentPaddingEnd || 0) + pad}px`;
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 3744c9e1e38..ce6c22ebe47 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -172,7 +172,7 @@ patchedDependencies:
'@expo/[email protected]': 90fa980e8b6480631fb2fbb04559834e3c612db40c550cd828f11be297d8d760
'@expo/[email protected]': 5a26480373850c1a7943919aa21f904151b335a0cb01042109e0746def37923e
'@ff-labs/[email protected]': cc71fcec015f4d39bc96ae2e2bf6b0ca678124c722c66a7841efce9d34b5983c
- '@legendapp/[email protected]': 680cc6a5c5b4a4032e467e7b3fde22f89a84c0ee2e6eac6fda737d6277cc0806
+ '@legendapp/[email protected]': e6383c516a0d67b65333d6fd38d2203734bf24b054b0b0767b034189205aed32
'@pierre/[email protected]': 2ec81ba1e8ce4681095a3473c2bf78e630417740c622720ef624febb467c25fc
'@react-native-ai/[email protected]': 2d09870c2848d185cb05b53ed823a46e12dba519324d8dd8e584e28731990f9d
'@react-native-menu/[email protected]': a4866ecfcd44f318043de839d20110c17e14909004900f002ffe12050376f2ba
@@ -352,7 +352,7 @@ importers:
'@legendapp/list':
specifier: 'catalog:'
'@material/material-color-utilities':
specifier: 0.3.0
version: 0.3.0
@@ -843,7 +843,7 @@ importers:
version: 0.9.0
'@legendapp/list':
specifier: 'catalog:'
'@noble/hashes':
specifier: 'catalog:'
version: 1.8.0
@@ -15377,7 +15377,7 @@ snapshots:
dependencies:
jsbi: 4.3.2
dependencies:
react: 19.3.0
use-sync-external-store: 1.6.0([email protected])