Skip to content

Commit

Permalink
Fix negative zoomScale in RTL
Browse files Browse the repository at this point in the history
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 (13a72e0)

Differential Revision: D36468390

fbshipit-source-id: f18244f1421fc1ccbb0d1035df8a7c6de10ccf62
  • Loading branch information
Blair Vanderhoof authored and facebook-github-bot committed May 18, 2022
1 parent 35e2a63 commit 2f491bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Libraries/Lists/VirtualizedList.js
Original file line number Diff line number Diff line change
Expand Up @@ -1627,7 +1627,8 @@ class VirtualizedList extends React.PureComponent<Props, State> {
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,
Expand Down

0 comments on commit 2f491bf

Please sign in to comment.