Skip to content

Navigation Menu

Sign in
Sign up

Fix viewability reporting for cross-orientation nested lists (#58412) - #58412

Open
amroaltah wants to merge 1 commit into
react:main from
amroaltah:export-D117727511
Open

Fix viewability reporting for cross-orientation nested lists (#58412) #58412
amroaltah wants to merge 1 commit into
react:main from
amroaltah:export-D117727511

Conversation

@amroaltah

@amroaltah amroaltah commented Sep 8, 2026
edited by meta-codesync Bot
Loading

Copy link
Copy Markdown

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 #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

@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

meta-codesync Bot commented Sep 8, 2026

Copy link
Copy Markdown

@amroaltah has exported this pull request. If you are a Meta employee, you can view the originating Diff in D117727511.

@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 7dd3c0f to 472aafe Compare September 9, 2026 17:30
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Milestone

No milestone

1 participant

AltStyle によって変換されたページ (->オリジナル) /