Commit 2e36e63
Add Fantom test verifying
Summary:
Pull Request resolved: #57444
`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]
Reviewed By: javache
Differential Revision: D110755346
fbshipit-source-id: ac9fa907ac623427192ed81dbfb2d8e55d8bc500onLayout does not bubble to ancestors (#57444)1 parent af3a651 commit 2e36e63
1 file changed
Lines changed: 44 additions & 0 deletions
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1582 | 1582 | | |
1583 | 1583 | | |
1584 | 1584 | | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
1585 | 1629 | | |
1586 | 1630 | | |
0 commit comments