Repository navigation
Commit b49769c
authored
fix(fabric): read hitSlop for all ViewKind children in getContentBounds
## Summary:
`YogaLayoutableShadowNode::getContentBounds()` previously read `hitSlop` only from children whose component handle matched `ViewShadowNode::Handle()`. Because `hitSlop` is defined on `BaseViewProps`, other `ConcreteViewShadowNode` components such as `ScrollView` also parse `hitSlop`, so their `hitSlop` extending past their parent's box never widened the parent's `overflowInset`.
Check `ShadowNodeTraits::ViewKind` instead and read `hitSlop` from `ViewProps`, matching how `YogaLayoutableShadowNode`, `PointerEventsProcessor`, and `LayoutAnimationKeyFrameManager` access `ViewProps`-derived nodes.
Fixes #60278
## Changelog:
[GENERAL] [FIXED] - Read `hitSlop` in `YogaLayoutableShadowNode::getContentBounds` for all `ViewKind` children (including `ScrollView`)
## Test Plan:
- Built and ran `react_renderer_components_view_tests` (via CMake/Make on macOS arm64 with `-lc++abi` for `libjsi.dylib`):
- `111 tests from 11 test suites ran` — `111 passed`, including all 7 tests in `LayoutTest.*` (`LayoutTest.overflowInsetScrollViewHitSlopTest` passed).
- `yarn eslint --max-warnings 0 packages/react-native/Libraries/Components/ScrollView/__tests__/ScrollView-itest.js` — passed.
- `yarn prettier --check packages/react-native/Libraries/Components/ScrollView/__tests__/ScrollView-itest.js` — passed.
- `node ./scripts/clang-format.js --check packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp packages/react-native/ReactCommon/react/renderer/components/view/tests/LayoutTest.cpp` — passed.
- `yarn flow-check` — 0 errors in source/test files (exited 2 locally due to pre-existing `.git/logs/refs/remotes/upstream/@chrfalch/prebuild-fix-missing-script-file-in-package.json` and `.git/refs/remotes/upstream/@chrfalch/prebuild-fix-missing-script-file-in-package.json`).
- Could not run `yarn fantom packages/react-native/Libraries/Components/ScrollView/__tests__/ScrollView-itest.js` locally (`fantom_tester` build failed on macOS due to disk space constraints / missing `-lc++abi` on `libjsi.dylib`); relying on CI `fantom-tests.yml` on Linux.
Differential Revision: D135332008
Pull Request resolved: #603601 parent 0ea7132 commit b49769c
3 files changed
Lines changed: 87 additions & 9 deletions
File tree
- packages/react-native
- Libraries/Components/ScrollView/__tests__
- ReactCommon/react/renderer/components/view
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
106 | 134 | | |
107 | 135 | | |
108 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
892 | 891 | | |
893 | 892 | | |
894 | 893 | | |
895 | | - | |
896 | | - | |
897 | | - | |
898 | | - | |
899 | | - | |
900 | | - | |
901 | | - | |
902 | | - | |
| 894 | + | |
| 895 | + | |
903 | 896 | | |
904 | 897 | | |
905 | 898 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
444 | 445 | | |
445 | 446 | | |
446 | 447 | | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
447 | 504 | | |
0 commit comments