Skip to content

Commit

Permalink
fix(rtl): fixed render element when languages is right to left
Browse files Browse the repository at this point in the history
  • Loading branch information
Giacomo Materozzi authored and Matergi committed Mar 1, 2023
1 parent afd0a8b commit a46b3ea
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core/VirtualRenderer.ts
@@ -1,3 +1,4 @@
import { I18nManager, Platform } from "react-native";
import RecycleItemPool from "../utils/RecycleItemPool";
import { Dimension, BaseLayoutProvider } from "./dependencies/LayoutProvider";
import CustomError from "./exceptions/CustomError";
Expand Down Expand Up @@ -97,7 +98,11 @@ export default class VirtualRenderer {

public updateOffset(offsetX: number, offsetY: number, isActual: boolean, correction: WindowCorrection): void {
if (this._viewabilityTracker) {
const offset = this._params && this._params.isHorizontal ? offsetX : offsetY;
const offset = this._params && this._params.isHorizontal ?
I18nManager.isRTL && Platform.OS === "android" ?
this.getLayoutDimension().width - offsetX :
offsetX
: offsetY;
if (!this._isViewTrackerRunning) {
if (isActual) {
this._viewabilityTracker.setActualOffset(offset);
Expand Down

0 comments on commit a46b3ea

Please sign in to comment.