Skip to content

Add Fantom test verifying onLayout does not bubble to ancestors#57444

Closed
rubennorte wants to merge 1 commit into
react:mainfrom
rubennorte:export-D110755346
Closed

Add Fantom test verifying onLayout does not bubble to ancestors#57444
rubennorte wants to merge 1 commit into
react:mainfrom
rubennorte:export-D110755346

Conversation

@rubennorte

Copy link
Copy Markdown
Member

Summary:
onLayout is a direct (non-bubbling) event, so a layout event fired on a child should not invoke an ancestor's onLayout prop handler. Add a Fantom integration test that renders a parent and child <View>, both with onLayout, then dispatches a layout event on the child and asserts the parent's onLayout prop is not called as a result.

The initial layout pass emits a real layout event for every view that has onLayout, and those events are flushed lazily on the first dispatched event. The test flushes them up front and snapshots the call counts before dispatching, so the parent's own mount-time layout event is not mistaken for bubbling.

Changelog: [Internal]

Differential Revision: D110755346

Summary:
`onLayout` is a direct (non-bubbling) event, so a layout event fired on a child should not invoke an ancestor's `onLayout` prop handler. Add a Fantom integration test that renders a parent and child `<View>`, both with `onLayout`, then dispatches a layout event on the child and asserts the parent's `onLayout` prop is not called as a result.

The initial layout pass emits a real layout event for every view that has `onLayout`, and those events are flushed lazily on the first dispatched event. The test flushes them up front and snapshots the call counts before dispatching, so the parent's own mount-time layout event is not mistaken for bubbling.

Changelog: [Internal]

Differential Revision: D110755346
@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 Jul 6, 2026
@meta-codesync

meta-codesync Bot commented Jul 6, 2026

Copy link
Copy Markdown

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

@meta-codesync

meta-codesync Bot commented Jul 6, 2026

Copy link
Copy Markdown

This pull request has been merged in 2e36e63.

@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant