From 2f491bfa9f86c3db2e459e331f39bc3cf12e7239 Mon Sep 17 00:00:00 2001 From: Blair Vanderhoof Date: Tue, 17 May 2022 21:50:25 -0700 Subject: [PATCH] Fix negative zoomScale in RTL Summary: Changelog: [iOS][Fixed] - When in an RTL locale on iOS, e.nativeEvent.zoomScale is -1. This seems to cause erratic blank spaces that don't recover as you scroll. Taking Math.abs of the value fixes it. Blame: D36169686 (https://github.com/facebook/react-native/commit/13a72e0ccceb2db6aeacd03b4f429d200392c17b) Differential Revision: D36468390 fbshipit-source-id: f18244f1421fc1ccbb0d1035df8a7c6de10ccf62 --- Libraries/Lists/VirtualizedList.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index 660a5d04431879..39e2f0be03776a 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -1627,7 +1627,8 @@ class VirtualizedList extends React.PureComponent { this._hasWarned.perf = true; } - const zoomScale = e.nativeEvent.zoomScale; + // e.nativeEvent.zoomScale is -1 in RTL so take absolute + const zoomScale = Math.abs(e.nativeEvent.zoomScale); this._scrollMetrics = { contentLength,