fix(VirtualizedList): sync virtualization logic with local direction style - #55481
Closed
Hector-Zhuang wants to merge 1 commit into
Closed
fix(VirtualizedList): sync virtualization logic with local direction style#55481Hector-Zhuang wants to merge 1 commit into
Hector-Zhuang wants to merge 1 commit into
Conversation
…style Summary: This commit fixes the blank rendering issue (Issue react#55433) that occurs when a VirtualizedList is used in an RTL environment but explicitly styled as LTR. The root cause was a mismatch between the JS-level coordinate normalization and the Native-level layout direction. While the native ScrollView rendered as LTR, the JS logic still applied RTL mirror calculations based on the global I18nManager state. Changes: 1. Updated `_orientation()` to prioritize the component's `style.direction` over the global `I18nManager.isRTL` setting. 2. In `render()`, explicitly calculated an `orientationStyle` based on the resolved direction and injected it into the ScrollView's style array. 3. This ensures that `_offsetFromScrollEvent` always uses a coordinate system that is perfectly aligned with the actual rendered layout. Fixes: react#55433
|
@CalixTang has imported this pull request. If you are a Meta employee, you can view this in D92766500. |
Collaborator
|
This PR is stale because it has been open for 180 days with no activity. It will be closed in 7 days unless you comment on it or remove the "Stale" label. |
Collaborator
|
This PR was closed because it has been stalled for 7 days with no activity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
This commit fixes the blank rendering and behavior issue that occurs when a VirtualizedList is used in an RTL environment but explicitly styled as LTR.
The root cause was a mismatch between the JS-level coordinate normalization and the Native-level layout direction. While the native ScrollView rendered as LTR, the JS logic still applied RTL mirror calculations based on the global I18nManager state. This issue occurs on both iOS and Android.
Changelog:
[GENERAL] [FIXED] - Synchronize VirtualizedList coordinate logic with local direction style to fix blank rendering in RTL environments.
Test Plan:
Expected Behavior:
Rendering: All items are rendered correctly during scroll.
Interaction: The scroll origin is at the left, and swiping follows LTR physics, matching the visual layout.
Actual Behavior (Before Fix):
Only the first few items appear; the rest are blank.
Related Issue
#55433