Skip to content

Commit

Permalink
Fix HorizontalScroll scroll position for RTL languages
Browse files Browse the repository at this point in the history
Summary: As title. Although I am not sure why the logic mentioned in D25585826 didn't work.

Reviewed By: adityasharat

Differential Revision: D69409572

fbshipit-source-id: 538a881ab1180d0a2de20b8a793df0e2d1db3986
  • Loading branch information
lebannen authored and facebook-github-bot committed Feb 10, 2025
1 parent 74ea258 commit 62f16a0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,15 @@ public void mount(
ScrollPosition scrollPosition,
int width,
int height,
int scrollX,
@Nullable OnScrollChangeListener onScrollChangeListener,
@Nullable ScrollStateListener scrollStateListener) {
mLithoView.setComponentTree(componentTree);
mScrollPosition = scrollPosition;
mOnScrollChangeListener = onScrollChangeListener;
mComponentWidth = width;
mComponentHeight = height;

setScrollX(scrollX);
if (scrollStateListener != null) {
if (mScrollStateDetector == null) {
mScrollStateDetector = new ScrollStateDetector(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ static void onMount(
lastScrollPosition,
componentWidth != null ? componentWidth : 0,
componentHeight != null ? componentHeight : 0,
lastScrollPosition.x,
onScrollChangeListener,
scrollStateListener);
Runnable preDrawRunnable =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class HorizontalScroll(
lastScrollPosition.value,
horizontalScrollLayoutData.measuredWidth,
horizontalScrollLayoutData.measuredHeight,
lastScrollPosition.value.x,
onScrollChangeListener,
scrollStateListener)
onUnbind { content.unmount() }
Expand Down

0 comments on commit 62f16a0

Please sign in to comment.