Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/node_modules/@shopify/flash-list/dist/recyclerview/utils/measureLayout.web.js b/node_modules/@shopify/flash-list/dist/recyclerview/utils/measureLayout.web.js
index 17d9812..fe112f1 100644
--- a/node_modules/@shopify/flash-list/dist/recyclerview/utils/measureLayout.web.js
+++ b/node_modules/@shopify/flash-list/dist/recyclerview/utils/measureLayout.web.js
@@ -28,7 +28,10 @@ export function areDimensionsEqual(value1, value2) {
return Math.abs(value1 - value2) <= 1;
}
export function roundOffPixel(value) {
- return value;
+ const dpr = typeof window !== "undefined" && window.devicePixelRatio
+ ? window.devicePixelRatio
+ : 1;
+ return Math.round(value * dpr) / dpr;
}
/**
* Measures the size of the RecyclerView's outer container.
9 changes: 9 additions & 0 deletions patches/@shopify/flash-list/details.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,12 @@
- Upstream PR/issue: https://github.com/Shopify/flash-list/issues/2291
- E/App issue: https://github.com/Expensify/App/issues/89933
- PR introducing patch: https://github.com/Expensify/App/pull/91248

### [@shopify+flash-list+2.3.0+010+fix-web-subpixel-rounding.patch](@shopify+flash-list+2.3.0+010+fix-web-subpixel-rounding.patch)

- Reason: Fixes a "Maximum update depth exceeded" infinite render loop on web (mostly Windows with fractional display scaling). `roundOffPixel` on web was a no-op, so subpixel drift in the child container's `getBoundingClientRect()` width re-triggered `ViewHolderCollection`'s `[fixedContainerSize]` layout effect on every measurement. The patch implements `roundOffPixel` to snap to the device-pixel grid (`Math.round(value * devicePixelRatio) / devicePixelRatio`), matching native `PixelRatio.roundToNearestPixel`. Two measurements that paint the same physical pixel now collapse to the same JS value, breaking the loop.
- Files changed: `dist/recyclerview/utils/measureLayout.web.js` only.
- Upstream PR/issue: TBD
- E/App issue: https://github.com/Expensify/App/issues/91584
- Sentry: https://expensify.sentry.io/issues/APP-DQ2
- PR introducing patch: https://github.com/Expensify/App/pull/91799
Loading