-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Fix viewability reporting for cross-orientation nested lists (#58412) - #58412
Open
amroaltah wants to merge 1 commit into
Open
Fix viewability reporting for cross-orientation nested lists (#58412) #58412amroaltah wants to merge 1 commit into
amroaltah wants to merge 1 commit into
Conversation
@meta-cla
meta-cla
Bot
added
the
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
label
Sep 8, 2026
@amroaltah has exported this pull request. If you are a Meta employee, you can view the originating Diff in D117727511.
@facebook-github-tools
facebook-github-tools
Bot
added
p: Facebook
Partner: Facebook
Partner
labels
Sep 8, 2026
@meta-codesync
meta-codesync
Bot
changed the title
(削除) Fix viewability reporting for cross-orientation nested lists (削除ここまで)
(追記) Fix viewability reporting for cross-orientation nested lists (#58412) (追記ここまで)
Sep 8, 2026
amroaltah
added a commit
to amroaltah/react-native
that referenced
this pull request
Sep 8, 2026
...8412) Summary: A horizontal `VirtualizedList` nested inside a vertical list could report its items through `onViewableItemsChanged` while the parent row was off screen. The existing same-orientation nesting path translates parent scroll metrics, but cross-orientation children have independent scroll axes and therefore need the visibility of their containing row as a separate signal. Expose a semantic cell-visibility query through `VirtualizedListContext` and register cross-orientation children with the key of their containing cell. Parents evaluate those cells after scroll and layout changes, but invoke children only when the ancestor suppression state transitions. Known data rows without layout metrics fail closed, eliminating transient mount reports, while unsupported structural cells preserve the previous behavior. Explicit suppression now clears previously published viewability tokens even when current cell metrics are unavailable. It also invalidates stale `minimumViewTime` work. Suppression propagates through deeper cross-orientation nesting, and parent registration is reconciled when orientation or context changes so unmount always cleans up the exact collection that was registered. The implementation is kept in sync across the main, Windows, and macOS variants. The generated public API snapshot is updated accordingly. Fixes react#57797 Fixes react#57778 Changelog: [General][Fixed] - Do not report viewable items for a cross-orientation nested list while its parent row is off screen Differential Revision: D117727511
amroaltah
force-pushed
the
export-D117727511
branch
2 times, most recently
from
September 9, 2026 17:30
7dd3c0f to
472aafe
Compare
amroaltah
added a commit
to amroaltah/react-native
that referenced
this pull request
Sep 9, 2026
...8412) Summary: A horizontal `VirtualizedList` nested inside a vertical list could report its items through `onViewableItemsChanged` while the parent row was off screen. The existing same-orientation nesting path translates parent scroll metrics, but cross-orientation children have independent scroll axes and therefore need the visibility of their containing row as a separate signal. Expose a semantic cell-visibility query through `VirtualizedListContext` and register cross-orientation children with the key of their containing cell. Parents evaluate those cells after scroll and layout changes, but invoke children only when the ancestor suppression state transitions. Known data rows without layout metrics fail closed, eliminating transient mount reports, while unsupported structural cells preserve the previous behavior. Explicit suppression now clears previously published viewability tokens even when current cell metrics are unavailable. It also invalidates stale `minimumViewTime` work. Suppression propagates through deeper cross-orientation nesting, and parent registration is reconciled when orientation or context changes so unmount always cleans up the exact collection that was registered. The implementation is kept in sync across the main, Windows, and macOS variants. The generated public API snapshot is updated accordingly. Fixes react#57797 Fixes react#57778 Changelog: [General][Fixed] - Do not report viewable items for a cross-orientation nested list while its parent row is off screen Differential Revision: D117727511
...8412) Summary: A horizontal `VirtualizedList` nested inside a vertical list could report its items through `onViewableItemsChanged` while the parent row was off screen. The existing same-orientation nesting path translates parent scroll metrics, but cross-orientation children have independent scroll axes and therefore need the visibility of their containing row as a separate signal. Expose a semantic cell-visibility query through `VirtualizedListContext` and register cross-orientation children with the key of their containing cell. Parents evaluate those cells after scroll and layout changes, but invoke children only when the ancestor suppression state transitions. Known data rows without layout metrics fail closed, eliminating transient mount reports, while unsupported structural cells preserve the previous behavior. Explicit suppression now clears previously published viewability tokens even when current cell metrics are unavailable. It also invalidates stale `minimumViewTime` work. Suppression propagates through deeper cross-orientation nesting, and parent registration is reconciled when orientation or context changes so unmount always cleans up the exact collection that was registered. The implementation is kept in sync across the main, Windows, and macOS variants. The generated public API snapshot is updated accordingly. Fixes react#57797 Fixes react#57778 Changelog: [General][Fixed] - Do not report viewable items for a cross-orientation nested list while its parent row is off screen Differential Revision: D117727511
amroaltah
force-pushed
the
export-D117727511
branch
from
September 9, 2026 20:34
472aafe to
12b128c
Compare
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.
Uh oh!
There was an error while loading. Please reload this page.
Summary:
A horizontal
VirtualizedListnested inside a vertical list could report its items throughonViewableItemsChangedwhile the parent row was off screen. The existing same-orientation nesting path translates parent scroll metrics, but cross-orientation children have independent scroll axes and therefore need the visibility of their containing row as a separate signal.Expose a semantic cell-visibility query through
VirtualizedListContextand register cross-orientation children with the key of their containing cell. Parents evaluate those cells after scroll and layout changes, but invoke children only when the ancestor suppression state transitions. Known data rows without layout metrics fail closed, eliminating transient mount reports, while unsupported structural cells preserve the previous behavior.Explicit suppression now clears previously published viewability tokens even when current cell metrics are unavailable. It also invalidates stale
minimumViewTimework. Suppression propagates through deeper cross-orientation nesting, and parent registration is reconciled when orientation or context changes so unmount always cleans up the exact collection that was registered.The implementation is kept in sync across the main, Windows, and macOS variants. The generated public API snapshot is updated accordingly.
Fixes #57797
Fixes #57778
Changelog:
[General][Fixed] - Do not report viewable items for a cross-orientation nested list while its parent row is off screen
Differential Revision: D117727511